X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=support%2Fsrc%2Forg%2Fwamblee%2Fgeneral%2FPair.java;h=fd8d494d0392fb5e42cc765fa86fdc8b19cf9cf5;hb=4f926b4a5f562024ad0abe38521b3755cfeeeea7;hp=f7a3d9728863d8acee7db0178ae2ec33728bcae0;hpb=643d979c351150ace01a8f9682f6c9f223854cd6;p=utils diff --git a/support/src/org/wamblee/general/Pair.java b/support/src/org/wamblee/general/Pair.java index f7a3d972..fd8d494d 100644 --- a/support/src/org/wamblee/general/Pair.java +++ b/support/src/org/wamblee/general/Pair.java @@ -12,37 +12,64 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ + */ package org.wamblee.general; /** - * Represents a pair of objects. This is inspired on the C++ Standard Template Library - * pair template. + * Represents a pair of objects. This is inspired on the C++ Standard Template + * Library pair template. * - * @param Type of the first object. - * @param Type of the second object. + * @param + * Type of the first object. + * @param + * Type of the second object. */ -public class Pair { - - private T _t; - private U _u; - - public Pair(T t, U u ) { - _t = t; - _u = u; - } - - public Pair(Pair p) { - _t = p._t; - _u = p._u; - } - - public T getFirst() { - return _t; - } - - public U getSecond() { - return _u; - } +public class Pair { + + private T _t; + + private U _u; + + /** + * Constructs the pair. + * + * @param aT + * First object. + * @param aU + * Second object. + */ + public Pair(T aT, U aU) { + _t = aT; + _u = aU; + } + + /** + * Copies a pair. + * + * @param aPair + * Pair to copy. + */ + public Pair(Pair aPair) { + _t = aPair._t; + _u = aPair._u; + } + + /** + * Gets the first object of the pair. + * + * @return First object. + */ + public T getFirst() { + return _t; + } + + /** + * Gets the second object of the pair. + * + * @return Second object. + */ + public U getSecond() { + return _u; + } }