Interface Pair<L,R>

Type Parameters:
L - the type of the left components
R - the type of the right components
All Superinterfaces:
Serializable
All Known Subinterfaces:
Pair_checkedLeft<L,R>, Pair_checkedRight<L,R>
All Known Implementing Classes:
CheckedPair_L, CheckedPair_LR, CheckedPair_R, UncheckedPair

public interface Pair<L,R> extends Serializable
Interface defining pair operations. A pair represents the combination of two values. These can have the same or different types. Implementing instances are mutable objects. Here no strictness is implied, but some subclasses do.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    As usual.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the left component of this pair.
    Return the right component of this pair.
    void
    Change the left value of this instance.
    void
    Change the right value of this instance.
    Deliver a new instance with the given left value and the right value of this instance.
    Deliver a new instance with the given right value and the left value of this instance.
  • Field Details

  • Method Details

    • get_left

      @Opt L get_left()
      Return the left component of this pair.
      Returns:
      the left component of this pair.
    • get_right

      @Opt R get_right()
      Return the right component of this pair.
      Returns:
      the right component of this pair.
    • with_left

      Pair<L,R> with_left(@Opt L l)
      Deliver a new instance with the given left value and the right value of this instance.
      Parameters:
      l - the new left value.
      Returns:
      a new instance.
    • with_right

      Pair<L,R> with_right(@Opt R r)
      Deliver a new instance with the given right value and the left value of this instance.
      Parameters:
      r - the new right value.
      Returns:
      a new instance.
    • set_left

      void set_left(@Opt L l)
      Change the left value of this instance.
      Parameters:
      l - the new left value.
    • set_right

      void set_right(@Opt R r)
      Change the right value of this instance.
      Parameters:
      r - the new right value.