This project has retired. For details please refer to its
Attic page.
Pair (Apache Crunch 0.7.0 API)
org.apache.crunch
Class Pair<K,V>
java.lang.Object
org.apache.crunch.Pair<K,V>
- All Implemented Interfaces:
- Comparable<Pair<K,V>>, Tuple
public class Pair<K,V>
- extends Object
- implements Tuple, Comparable<Pair<K,V>>
A convenience class for two-element Tuple
s.
Constructor Summary |
Pair(K first,
V second)
|
Pair
public Pair(K first,
V second)
of
public static <T,U> Pair<T,U> of(T first,
U second)
first
public K first()
second
public V second()
get
public Object get(int index)
- Description copied from interface:
Tuple
- Returns the Object at the given index.
- Specified by:
get
in interface Tuple
size
public int size()
- Description copied from interface:
Tuple
- Returns the number of elements in this Tuple.
- Specified by:
size
in interface Tuple
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
compareTo
public int compareTo(Pair<K,V> o)
- Specified by:
compareTo
in interface Comparable<Pair<K,V>>
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.