|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.javelot.functionalj.tuple.Pair
info.javelot.functionalj.tuple.Triple
Used to create a tuple of three objects. Tuples can be used anywhere
there is a need to group objects together, and Triples are used by the
Tuples.zip(Collection, Collection, Collection) method.
| Field Summary | |
static Function1 |
third
Function that returns the third element of the tuple. |
static Function3 |
triple
Function that creates a Triple. |
| Fields inherited from class info.javelot.functionalj.tuple.Pair |
first, pair, second |
| Constructor Summary | |
Triple(Object p_first,
Object p_second,
Object p_third)
Creates a tuple of the three given objects. |
|
| Method Summary | |
int |
compareTo(Object p_object)
Sort tuples according to the objects that they contain. |
boolean |
equals(Object p_object)
Determines if the given object is equal to this object, by comparing the three objects of each triple. |
protected List |
getStrings()
Returns a list of the String representations of the objects of the tuple. |
Object |
getThird()
Returns the third object of the tuple. |
int |
hashCode()
Returns the hash code associated with this object. |
void |
setThird(Object p_third)
Sets the third object of the tuple. |
| Methods inherited from class info.javelot.functionalj.tuple.Pair |
getFirst, getSecond, setFirst, setSecond, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final Function3 triple
public static final Function1 third
| Constructor Detail |
public Triple(Object p_first,
Object p_second,
Object p_third)
p_third - the third object of the triple. A null value is
accepted. The first two parameters are those accepted by Pair.Pair(Object, Object).Pair.Pair(Object, Object)| Method Detail |
public Object getThird()
null.public void setThird(Object p_third)
p_third - the third object of the tuple.public int hashCode()
hashCode in class PairPair.hashCode()public boolean equals(Object p_object)
equals in class Pairp_object - the object against which to compare this tuple.
true if the pairs contain the same values;
false otherwise.Pair.equals(Object)public int compareTo(Object p_object)
PairComparable interface, they
are left unsorted.
compareTo in interface ComparablecompareTo in class Pairprotected List getStrings()
getStrings in class PairPair.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||