edu.rice.cs.plt.tuple
Class Triple<T1,T2,T3>

java.lang.Object
  extended by edu.rice.cs.plt.tuple.Tuple
      extended by edu.rice.cs.plt.tuple.Triple<T1,T2,T3>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
IdentityTriple

public class Triple<T1,T2,T3>
extends Tuple

An arbitrary 3-tuple of objects; overrides toString(), equals(Object), and Tuple.hashCode().

See Also:
Serialized Form

Field Summary
protected  T1 _first
           
protected  T2 _second
           
protected  T3 _third
           
 
Constructor Summary
Triple(T1 first, T2 second, T3 third)
           
 
Method Summary
static
<T1 extends Comparable<? super T1>,T2 extends Comparable<? super T2>,T3 extends Comparable<? super T3>>
TotalOrder<Triple<? extends T1,? extends T2,? extends T3>>
comparator()
          Produce a comparator for triples, ordered by the natural order of the elements (the leftmost elements have the highest sort priority).
static
<T1,T2,T3> TotalOrder<Triple<? extends T1,? extends T2,? extends T3>>
comparator(Comparator<? super T1> comp1, Comparator<? super T2> comp2, Comparator<? super T3> comp3)
          Produce a comparator for triples, ordered by the given comparators (the leftmost elements have the highest sort priority).
 boolean equals(Object o)
           
static
<T1,T2,T3> Lambda3<T1,T2,T3,Triple<T1,T2,T3>>
factory()
          Produce a lambda that invokes the constructor
 T1 first()
           
static
<T> Lambda<Triple<? extends T,?,?>,T>
firstGetter()
          Produce a lambda that invokes first() on a provided triple.
protected  int generateHashCode()
           
static
<T1,T2,T3> Triple<T1,T2,T3>
make(T1 first, T2 second, T3 third)
          Call the constructor (allows the type arguments to be inferred)
 T2 second()
           
static
<T> Lambda<Triple<?,? extends T,?>,T>
secondGetter()
          Produce a lambda that invokes second() on a provided triple.
 T3 third()
           
static
<T> Lambda<Triple<?,?,? extends T>,T>
thirdGetter()
          Produce a lambda that invokes third() on a provided triple.
 String toString()
           
 
Methods inherited from class edu.rice.cs.plt.tuple.Tuple
hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_first

protected final T1 _first

_second

protected final T2 _second

_third

protected final T3 _third
Constructor Detail

Triple

public Triple(T1 first,
              T2 second,
              T3 third)
Method Detail

first

public T1 first()

second

public T2 second()

third

public T3 third()

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object
Returns:
true iff this is of the same class as o, and each corresponding element is equal (according to equals)

generateHashCode

protected int generateHashCode()
Specified by:
generateHashCode in class Tuple

make

public static <T1,T2,T3> Triple<T1,T2,T3> make(T1 first,
                                               T2 second,
                                               T3 third)
Call the constructor (allows the type arguments to be inferred)


factory

public static <T1,T2,T3> Lambda3<T1,T2,T3,Triple<T1,T2,T3>> factory()
Produce a lambda that invokes the constructor


firstGetter

public static <T> Lambda<Triple<? extends T,?,?>,T> firstGetter()
Produce a lambda that invokes first() on a provided triple.


secondGetter

public static <T> Lambda<Triple<?,? extends T,?>,T> secondGetter()
Produce a lambda that invokes second() on a provided triple.


thirdGetter

public static <T> Lambda<Triple<?,?,? extends T>,T> thirdGetter()
Produce a lambda that invokes third() on a provided triple.


comparator

public static <T1 extends Comparable<? super T1>,T2 extends Comparable<? super T2>,T3 extends Comparable<? super T3>> TotalOrder<Triple<? extends T1,? extends T2,? extends T3>> comparator()
Produce a comparator for triples, ordered by the natural order of the elements (the leftmost elements have the highest sort priority).


comparator

public static <T1,T2,T3> TotalOrder<Triple<? extends T1,? extends T2,? extends T3>> comparator(Comparator<? super T1> comp1,
                                                                                               Comparator<? super T2> comp2,
                                                                                               Comparator<? super T3> comp3)
Produce a comparator for triples, ordered by the given comparators (the leftmost elements have the highest sort priority).