Pairpublic class Pair extends Object Container to ease passing around a tuple of two objects. This object provides a sensible
implementation of equals(), returning true if equals() is true on each of the contained
objects. |
Fields Summary |
---|
public final F | first | public final S | second |
Constructors Summary |
---|
public Pair(F first, S second)Constructor for a Pair.
this.first = first;
this.second = second;
|
Methods Summary |
---|
public static android.support.v4.util.Pair | create(A a, B b)Convenience method for creating an appropriately typed pair.
return new Pair<A, B>(a, b);
| public boolean | equals(java.lang.Object o)Checks the two objects for equality by delegating to their respective
{@link Object#equals(Object)} methods.
if (!(o instanceof Pair)) {
return false;
}
Pair<?, ?> p = (Pair<?, ?>) o;
return objectsEqual(p.first, first) && objectsEqual(p.second, second);
| public int | hashCode()Compute a hash code using the hash codes of the underlying objects
return (first == null ? 0 : first.hashCode()) ^ (second == null ? 0 : second.hashCode());
| private static boolean | objectsEqual(java.lang.Object a, java.lang.Object b)
return a == b || (a != null && a.equals(b));
|
|