|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.util.Tuple
This class represents an ordered 2-Tuple that is consistent with
equals()
and hashCode()
. Therefor it can
safely be used within Hashtables, HashSets, HashMaps and the like.
Using the static create
methods, it is possible to
build 3,4,5-Tuples recursively out of multiple 2-Tuples.
Field Summary | |
Object |
o1
The first element of the Tuple |
Object |
o2
The second element of the Tuple |
Constructor Summary | |
Tuple(Object o1,
Object o2)
Constructs a 2-Tuple using the two given Objects |
Method Summary | |
static Object |
create(Object o1,
Object o2)
Factory method to create a 2-Tuple |
static Object |
create(Object o1,
Object o2,
Object o3)
Factory method to create a 3-Tuple |
static Object |
create(Object o1,
Object o2,
Object o3,
Object o4)
Factory method to create a 4-Tuple |
static Object |
create(Object o1,
Object o2,
Object o3,
Object o4,
Object o5)
Factory method to create a 5-Tuple |
boolean |
equals(Object o)
Determines if the given Tuple equals another Tuple. |
int |
hashCode()
Generates a hashCode using the two tuple elements. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public final Object o1
public final Object o2
Constructor Detail |
public Tuple(Object o1, Object o2)
o1
- The first element (may be null
)o2
- The second element (may be null
)Method Detail |
public final boolean equals(Object o)
true
.
equals
in class Object
o
- the element to compare this tuple with
public final int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public static final Object create(Object o1, Object o2)
public static final Object create(Object o1, Object o2, Object o3)
public static final Object create(Object o1, Object o2, Object o3, Object o4)
public static final Object create(Object o1, Object o2, Object o3, Object o4, Object o5)
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |