|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Util.Tuple
public class Tuple
A Tuple
is an ordered list of objects that works
properly in Hashtables & etc. Tuples may have null
elements.
Tuple
s are Comparable
iff the objects in
the elements array are Comparable
.
Constructor Summary | |
---|---|
Tuple(Object[] elements)
Creates a Tuple . |
|
Tuple(Object[] elements,
Comparator objcmp)
Creates a Comparable Tuple which will use
the specified Comparator to do object comparisons. |
Method Summary | |
---|---|
List |
asList()
Returns an unmodifiable list view of the Tuple . |
int |
compareTo(Object o)
Does an element-by-element comparison of two Tuple s. |
boolean |
equals(Object obj)
Does an element-by-element comparison of two Tuple s. |
int |
hashCode()
Synthesizes a hashcode from the hashcodes of the elements. |
Object |
proj(int i)
Projects an element of the Tuple . |
String |
toString()
Returns a human-readable description of this Tuple . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Tuple(Object[] elements)
Tuple
.
public Tuple(Object[] elements, Comparator objcmp)
Comparable
Tuple
which will use
the specified Comparator
to do object comparisons.
Method Detail |
---|
public Object proj(int i)
Tuple
.
public List asList()
Tuple
.
public String toString()
Tuple
.
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
Tuple
s.
equals
in class Object
public int compareTo(Object o)
Tuple
s.
Inconsistent with equals()
only if the underlying
comparator is. Shorter tuples are compared as less than longer
tuples.
compareTo
in interface Comparable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |