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.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 Objects.equal(p.first, first) && Objects.equal(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());
|
|