Interface OrderedPair<U,V>

Type Parameters:
U - the type of the first element of the pair
V - the type of the second element of the pair
All Known Implementing Classes:
NonNullOrderedPair, SimpleOrderedPair

public interface OrderedPair<U,V>
An ordered pair.

This is a value-type.

Author:
Werner Randelshofer
  • Method Summary

    Modifier and Type
    Method
    Description
     
    static <U, V> boolean
    orderedPairEquals(OrderedPair<U,V> pair, @Nullable Object obj)
    Checks if a given ordered pair is equal to a given object.
    static <U, V> int
    Computes a hash code for an ordered pair.
     
  • Method Details

    • first

      U first()
    • second

      V second()
    • orderedPairEquals

      static <U, V> boolean orderedPairEquals(OrderedPair<U,V> pair, @Nullable Object obj)
      Checks if a given ordered pair is equal to a given object.
      Type Parameters:
      U - the type of the first element of the pair
      V - the type of the second element of the pair
      Parameters:
      pair - an ordered pair
      obj - an object
      Returns:
      true if equal
    • orderedPairHashCode

      static <U, V> int orderedPairHashCode(OrderedPair<U,V> pair)
      Computes a hash code for an ordered pair. The hash code is guaranteed to be non-zero.
      Type Parameters:
      U - the type of the first element of the pair
      V - the type of the second element of the pair
      Parameters:
      pair - an ordered pair
      Returns:
      the hash code