Interface CoPair<L,R>

Type Parameters:
L - the type of the left components
R - the type of the right components
All Superinterfaces:
Serializable
All Known Subinterfaces:
CoPair_checkedLeft<L,R>, CoPair_checkedRight<L,R>
All Known Implementing Classes:
CheckedCoPair_L, CheckedCoPair_LR, CheckedCoPair_R, UncheckedCoPair

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

    Modifier and Type
    Method
    Description
    As usual.+/ static final long serialVersionUID = -6377989869262315836L; /** Return the stored value, if this instance realizes the left variant.
    Return the stored value, if this instance realizes the right variant.
    boolean
    Return whether this instance realizes the left variant.
    void
    Set this instance to realizes the left variant and set its value.
    void
    Set this instance to realizes the right variant and set its value.
  • Method Details

    • get_left

      @Opt L get_left()
      As usual.+/ static final long serialVersionUID = -6377989869262315836L; /** Return the stored value, if this instance realizes the left variant.
      Returns:
      the stored value, if this instance realizes the left variant.
      Throws:
      IllegalStateException - if this instance does not realize the left variant.
    • get_right

      @Opt R get_right()
      Return the stored value, if this instance realizes the right variant.
      Returns:
      the stored value, if this instance realizes the right variant.
      Throws:
      IllegalStateException - if this instance does not realize the realize variant.
    • isLeft

      boolean isLeft()
      Return whether this instance realizes the left variant.
      Returns:
      whether this instance realizes the left variant.
    • set_left

      void set_left(@Opt L l)
      Set this instance to realizes the left variant and set its value.
      Parameters:
      l - the value to be stored.
      Throws:
      NullPointerException - if the implementing class does not permit null values as a left variant.
    • set_right

      void set_right(@Opt R r)
      Set this instance to realizes the right variant and set its value.
      Parameters:
      r - the value to be stored.
      Throws:
      NullPointerException - if the implementing class does not permit null values as a right variant.