Class Pair<T>
java.lang.Object
uk.ac.starlink.util.Pair<T>
Aggregates two objects of the same type.
This utility class does not do anything clever.
- Since:
- 12 Sep 2019
- Author:
- Mark Taylor
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetItem1()Returns this pair's first item.getItem2()Returns this item's second item.inthashCode()static <S> Pair<S[]> splitArray(S[] in) Splits an array into two consituent parts.static <S> Pair<Collection<S>> splitCollection(Collection<S> in) Splits a collection into two constituent parts.toString()
-
Constructor Details
-
Pair
-
-
Method Details
-
getItem1
-
getItem2
-
hashCode
-
equals
-
toString
-
splitCollection
Splits a collection into two constituent parts.- Parameters:
in- input collection; unaffected on exit- Returns:
- pair of non-null collections (currently Lists), each containing about half of the input collection
-
splitArray
Splits an array into two consituent parts.- Parameters:
in- input array; unaffected on exit- Returns:
- pair of non-null arrays, each containing about half of the input array
-