X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=support%2Fsrc%2Forg%2Fwamblee%2Fgeneral%2FPair.java;h=a6bc544d6e55f3b5c9cbcc4b3912592f67aaead8;hb=8f2d78e446f48a1ed156b252998ae17cd6f0ba2b;hp=f7a3d9728863d8acee7db0178ae2ec33728bcae0;hpb=843fadabbebb32b83f4db1d27a1c60e3354b8c19;p=utils diff --git a/support/src/org/wamblee/general/Pair.java b/support/src/org/wamblee/general/Pair.java index f7a3d972..a6bc544d 100644 --- a/support/src/org/wamblee/general/Pair.java +++ b/support/src/org/wamblee/general/Pair.java @@ -1,3 +1,6 @@ + + + /* * Copyright 2005 the original author or authors. * @@ -12,37 +15,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; + } }