Class UncheckedPair<L,R>

java.lang.Object
eu.bandm.tools.umod.runtime.UncheckedPair<L,R>
Type Parameters:
L - the type of the left components
R - the type of the right components
All Implemented Interfaces:
Pair<L,R>, Serializable
Direct Known Subclasses:
CheckedPair_L, CheckedPair_LR, CheckedPair_R

public class UncheckedPair<L,R> extends Object implements Pair<L,R>
Implements "Pair" operations, but no strictness.
See Also:
  • Constructor Details

    • UncheckedPair

      public UncheckedPair(@Opt L left, @Opt R right)
      Create an instance with the given left and right values.
      Parameters:
      left - the left value
      right - the right value
    • UncheckedPair

      public UncheckedPair(Pair<L,R> p)
      Create an instance with the values from the prototype.
      Parameters:
      p - the prototype.
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • get_left

      @Opt public L get_left()
      Description copied from interface: Pair
      Return the left component of this pair.
      Specified by:
      get_left in interface Pair<L,R>
      Returns:
      the left component of this pair.
    • get_right

      @Opt public R get_right()
      Description copied from interface: Pair
      Return the right component of this pair.
      Specified by:
      get_right in interface Pair<L,R>
      Returns:
      the right component of this pair.
    • with_left

      public UncheckedPair<L,R> with_left(@Opt L l)
      Description copied from interface: Pair
      Deliver a new instance with the given left value and the right value of this instance.
      Specified by:
      with_left in interface Pair<L,R>
      Parameters:
      l - the new left value.
      Returns:
      a new instance.
    • with_right

      public UncheckedPair<L,R> with_right(@Opt R r)
      Description copied from interface: Pair
      Deliver a new instance with the given right value and the left value of this instance.
      Specified by:
      with_right in interface Pair<L,R>
      Parameters:
      r - the new right value.
      Returns:
      a new instance.
    • set_left

      public void set_left(@Opt L l)
      Description copied from interface: Pair
      Change the left value of this instance.
      Specified by:
      set_left in interface Pair<L,R>
      Parameters:
      l - the new left value.
    • set_right

      public void set_right(@Opt R r)
      Description copied from interface: Pair
      Change the right value of this instance.
      Specified by:
      set_right in interface Pair<L,R>
      Parameters:
      r - the new right value.
    • fromIterables_unchecked

      public static <A, B> List<UncheckedPair<A,B>> fromIterables_unchecked(Iterable<A> left, Iterable<B> right, Class<A> lclass, Class<B> rclass)
      Create a list of instances which contains all possible combinations of the given values.
      Type Parameters:
      A - the type of the left values
      B - the type of the left values
      Parameters:
      left - the left values
      right - the right values
      lclass - the type of the left values
      rclass - the type of the left values
      Returns:
      the list of all combinations
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object