|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.util.Tuple
public final class Tuple
This class represents an ordered 2-Tuple that is consistent with
equals()
and hashCode()
. Therefore 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 | |
---|---|
java.lang.Object |
o1
The first element of the Tuple |
java.lang.Object |
o2
The second element of the Tuple |
Constructor Summary | |
---|---|
Tuple(java.lang.Object o1,
java.lang.Object o2)
Constructs a 2-Tuple using the two given Objects |
Method Summary | |
---|---|
static java.lang.Object |
create(java.lang.Object o1,
java.lang.Object o2)
Factory method to create a 2-Tuple |
static java.lang.Object |
create(java.lang.Object o1,
java.lang.Object o2,
java.lang.Object o3)
Factory method to create a 3-Tuple |
static java.lang.Object |
create(java.lang.Object o1,
java.lang.Object o2,
java.lang.Object o3,
java.lang.Object o4)
Factory method to create a 4-Tuple |
static java.lang.Object |
create(java.lang.Object o1,
java.lang.Object o2,
java.lang.Object o3,
java.lang.Object o4,
java.lang.Object o5)
Factory method to create a 5-Tuple |
boolean |
equals(java.lang.Object o)
Determines if the given Tuple equals another Tuple. |
int |
hashCode()
Generates a hashCode using the two tuple elements. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final java.lang.Object o1
public final java.lang.Object o2
Constructor Detail |
---|
public Tuple(java.lang.Object o1, java.lang.Object o2)
o1
- The first element (may be null
)o2
- The second element (may be null
)Method Detail |
---|
public final boolean equals(java.lang.Object o)
true
.
equals
in class java.lang.Object
o
- the element to compare this tuple with
public final int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static final java.lang.Object create(java.lang.Object o1, java.lang.Object o2)
public static final java.lang.Object create(java.lang.Object o1, java.lang.Object o2, java.lang.Object o3)
public static final java.lang.Object create(java.lang.Object o1, java.lang.Object o2, java.lang.Object o3, java.lang.Object o4)
public static final java.lang.Object create(java.lang.Object o1, java.lang.Object o2, java.lang.Object o3, java.lang.Object o4, java.lang.Object o5)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |