Class ObjectObjectImmutablePair<K,V>

java.lang.Object
it.unimi.dsi.fastutil.objects.ObjectObjectImmutablePair<K,V>
All Implemented Interfaces:
it.unimi.dsi.fastutil.Pair<K,V>, Serializable
Direct Known Subclasses:
ObjectObjectImmutableSortedPair

public class ObjectObjectImmutablePair<K,V> extends Object implements it.unimi.dsi.fastutil.Pair<K,V>, Serializable
A type-specific immutable Pair; provides some additional methods that use polymorphism to avoid (un)boxing.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final K
     
    protected final V
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new type-specific immutable Pair with given left and right value.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object other)
     
    int
     
     
    static <K, V> ObjectObjectImmutablePair<K,V>
    of(K left, V right)
    Returns a new type-specific immutable Pair with given left and right value.
     
    Returns a string representation of this pair in the form <l,r>.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface it.unimi.dsi.fastutil.Pair

    first, first, key, key, left, right, second, second, value, value
  • Field Details

    • left

      protected final K left
  • Constructor Details

    • ObjectObjectImmutablePair

      public ObjectObjectImmutablePair(K 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 <K, V> ObjectObjectImmutablePair<K,V> of(K 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.
    • left

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

      public V right()
      Specified by:
      right in interface it.unimi.dsi.fastutil.Pair<K,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>.