|
|||||||||
| 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.
Tuples 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 Tuples. |
boolean |
equals(Object obj)
Does an element-by-element comparison of two Tuples. |
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 Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
Tuples.
equals in class Objectpublic int compareTo(Object o)
Tuples.
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 | ||||||||