diff options
Diffstat (limited to 'src/jrummikub/util')
-rw-r--r-- | src/jrummikub/util/Pair.java | 61 |
1 files changed, 35 insertions, 26 deletions
diff --git a/src/jrummikub/util/Pair.java b/src/jrummikub/util/Pair.java index 76eea4f..7083bc3 100644 --- a/src/jrummikub/util/Pair.java +++ b/src/jrummikub/util/Pair.java @@ -2,36 +2,45 @@ package jrummikub.util; /** * A pair of objects - * @param <T1> the first type of the pair - * @param <T2> the second type of the pair + * + * @param <T1> + * Type of first component + * @param <T2> + * Type of second component */ public class Pair<T1, T2> { - private final T1 first; - private final T2 second; + private final T1 first; + private final T2 second; - /** - * Create a new pair - * - * @param first the first value - * @param second the second value - */ - public Pair(T1 first, T2 second) { - this.first = first; - this.second = second; - } + /** + * Create a new pair from two values + * + * @param first + * the first pair component + * @param second + * the second pair component + */ + public Pair(T1 first, T2 second) { + this.first = first; + this.second = second; + } - /** - * @return the first value - */ - public T1 getFirst() { - return first; - } + /** + * Extract the first component of a pair + * + * @return the first pair component + */ + public T1 getFirst() { + return first; + } - /** - * @return the first value - */ - public T2 getSecond() { - return second; - } + /** + * Extract the second component of a pair + * + * @return the second pair component + */ + public T2 getSecond() { + return second; + } } |