Home | History | Annotate | Download | only in util

Lines Matching defs:Pair

21  * Define our own Pair class which contains two objects.
23 public class Pair<A, B> {
27 public Pair(A first, B second) {
37 if (!(o instanceof Pair)) {
38 // o is not an instance of Pair object
41 final Pair<?, ?> pair = (Pair<?, ?>) o;
42 if (this == pair) {
47 if (pair.first != null) {
50 } else if (!this.first.equals(pair.first)) {
54 if (pair.second != null) {
57 } else if (!this.second.equals(pair.second)) {
71 * Convenience method to create a new pair.
72 * @param a the first object in the Pair
73 * @param b the second object in the Pair
74 * @return a Pair contains a and b
76 public static <A, B> Pair<A, B> create(A a, B b) {
77 return new Pair<A, B> (a, b);