- Type Parameters:
U- the type of the first element of the pairV- 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 TypeMethodDescriptionfirst()static <U,V> boolean orderedPairEquals(@NonNull OrderedPair<U, V> pair, @Nullable Object obj) Checks if a given ordered pair is equal to a given object.static <U,V> int orderedPairHashCode(@NonNull OrderedPair<U, V> pair) Computes a hash code for an ordered pair.second()
-
Method Details
-
first
U first() -
second
V second() -
orderedPairEquals
Checks if a given ordered pair is equal to a given object.- Type Parameters:
U- the type of the first element of the pairV- the type of the second element of the pair- Parameters:
pair- an ordered pairobj- an object- Returns:
- true if equal
-
orderedPairHashCode
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 pairV- the type of the second element of the pair- Parameters:
pair- an ordered pair- Returns:
- the hash code
-