util
Class Triple<A,B,C>

java.lang.Object
  extended by util.Triple<A,B,C>
Type Parameters:
A - The type of the first element of a triple.
B - The type of the second element of a triple.
C - The type of the third element of a triple.
All Implemented Interfaces:
Serializable

public class Triple<A,B,C>
extends Object
implements Serializable

A triple of objects of some specified types. Convenient for return values, etc.

See Also:
Serialized Form

Field Summary
 A a
          The first element of the triple.
 B b
          The second element of the triple.
 C c
          The third element of the triple.
 
Constructor Summary
Triple(A a, B b, C c)
           
 
Method Summary
 boolean equals(Object other)
           
 int hashCode()
           
static
<A,B,C> Triple<A,B,C>
of(A a, B b, C c)
          A more readable synonym for triple(A, B, C).
 String toString()
           
static
<A,B,C> Triple<A,B,C>
triple(A a, B b, C c)
          A convenience method so that the types of the elements don't have to be given explicitly.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

a

public final A a
The first element of the triple.


b

public final B b
The second element of the triple.


c

public final C c
The third element of the triple.

Constructor Detail

Triple

public Triple(A a,
              B b,
              C c)
Parameters:
a - The first element of the triple.
b - The second element of the triple.
c - The third element of the triple.
Method Detail

triple

public static <A,B,C> Triple<A,B,C> triple(A a,
                                           B b,
                                           C c)
A convenience method so that the types of the elements don't have to be given explicitly.

Type Parameters:
A - The type of the first element.
B - The type of the second element.
C - The type of the third element.
Parameters:
a - The first element of the triple.
b - The second element of the triple.
c - The third element of the triple.
Returns:
A newly constructed triple.

of

public static <A,B,C> Triple<A,B,C> of(A a,
                                       B b,
                                       C c)
A more readable synonym for triple(A, B, C).

Type Parameters:
A - The type of the first element.
B - The type of the second element.
C - The type of the third element.
Parameters:
a - The first element of the triple.
b - The second element of the triple.
c - The third element of the triple.
Returns:
A newly constructed triple.

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object