(no commit message)
[utils] / support / src / org / wamblee / general / Pair.java
index f7a3d9728863d8acee7db0178ae2ec33728bcae0..fd8d494d0392fb5e42cc765fa86fdc8b19cf9cf5 100644 (file)
  * 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 <T> Type of the first object. 
- * @param <U> Type of the second object. 
+ * @param <T>
+ *            Type of the first object.
+ * @param <U>
+ *            Type of the second object.
  */
-public class Pair<T,U> {
-       
-       private T _t; 
-       private U _u; 
-       
-       public Pair(T t, U u ) {
-           _t = t; 
-           _u = u; 
-       }
-       
-       public Pair(Pair<T,U> p) {
-               _t = p._t; 
-               _u = p._u; 
-       }
-       
-       public T getFirst() {
-               return _t; 
-       }
-       
-       public U getSecond() {
-               return _u; 
-       }
+public class Pair<T, U> {
+
+    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<T, U> 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;
+    }
 
 }