Class BooleanObjectImmutablePair<V>

java.lang.Object
it.unimi.dsi.fastutil.booleans.BooleanObjectImmutablePair<V>
All Implemented Interfaces:
BooleanObjectPair<V>, it.unimi.dsi.fastutil.Pair<Boolean,V>, Serializable

public class BooleanObjectImmutablePair<V> extends Object implements BooleanObjectPair<V>, Serializable
A type-specific immutable Pair; provides some additional methods that use polymorphism to avoid (un)boxing.
See Also:
  • Field Details

    • left

      protected final boolean left
  • Constructor Details

    • BooleanObjectImmutablePair

      public BooleanObjectImmutablePair(boolean left, V right)
      Creates a new type-specific immutable Pair with given left and right value.
      Parameters:
      left - the left value.
      right - the right value.
  • Method Details

    • of

      public static <V> BooleanObjectImmutablePair<V> of(boolean left, V right)
      Returns a new type-specific immutable Pair with given left and right value.
      Parameters:
      left - the left value.
      right - the right value.
    • leftBoolean

      public boolean leftBoolean()
      Description copied from interface: BooleanObjectPair
      Returns the left element of this pair.
      Specified by:
      leftBoolean in interface BooleanObjectPair<V>
      Returns:
      the left element of this pair.
    • right

      public V right()
      Specified by:
      right in interface it.unimi.dsi.fastutil.Pair<Boolean,V>
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Returns a string representation of this pair in the form <l,r>.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this pair in the form <l,r>.