More javadocs for the model
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@64 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
91b921248f
commit
1e7cdb33f5
8 changed files with 153 additions and 51 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue