rcf.core.util.groups
Class Triple<A,B,C>
java.lang.Object
rcf.core.util.groups.Singleton<A>
rcf.core.util.groups.Pair<A,B>
rcf.core.util.groups.Triple<A,B,C>
- Type Parameters:
A - The type of the first entry in each triple.B - The type of the second entry in each triple.C - The type of the third entry in each triple.
- All Implemented Interfaces:
- ImmutablePairInterface<A,B>, ImmutableSingletonInterface<A>, ImmutableTripleInterface<A,B,C>, PairInterface<A,B>, SingletonInterface<A>, TripleInterface<A,B,C>
@Revision(value="$Revision: 1.38 $",
date="$Date: 2006/11/09 02:10:10 $",
tag="$Name: $")
public class Triple<A,B,C>- extends Pair<A,B>
- implements TripleInterface<A,B,C>
TODO: Javadoc
Provides a simple, type safe (generic) wrapper which can encapsulate a triple of
references. This is effectively a multi-type, type safe limited length array.
- Version:
- $Revision: 1.38 $
- Author:
- Greg Gibeling
|
Nested Class Summary |
static class |
Triple.Iterable<A,B,C>
TODO: Javadoc
Binds a triple of iterable objects, allowing them to be iterated simultaneously. |
static class |
Triple.Iterator<A,B,C>
TODO: Javadoc
Binds a triple of iterators, allowing them to be iterated simultaneously. |
|
Field Summary |
protected C |
c
TODO: Javadoc The third object to store. |
| Fields inherited from class rcf.core.util.groups.Pair |
b |
| Fields inherited from class rcf.core.util.groups.Singleton |
a |
|
Constructor Summary |
Triple(A _a,
B _b,
C _c)
TODO: Javadoc
Base constructor, simply records the elements for this object. |
|
Method Summary |
static
|
composeArrays(A[] a,
B[] b,
C[] c)
TODO: Javadoc
Compose three arrays of values into an array of triples of values. |
static
|
decomposeArrays(T[] t)
TODO: Javadoc
Decompose an array of triples into a triple of arrays of values. |
boolean |
equals(Object o)
|
C |
getC()
TODO: Javadoc
Get the third element of this triple. |
int |
hashCode()
|
void |
set(A _a,
B _b,
C _c)
TODO: Javadoc |
C |
setC(C _c)
TODO: Javadoc
Set the third element of this triple. |
String |
toString()
|
c
protected C c
- TODO: Javadoc The third object to store.
Triple
public Triple(A _a,
B _b,
C _c)
- TODO: Javadoc
Base constructor, simply records the elements for this object.
- Parameters:
_a - The first object to store._b - The second object to store._c - The third object to store.
composeArrays
public static final <A,B,C> Triple<A,B,C>[] composeArrays(A[] a,
B[] b,
C[] c)
- TODO: Javadoc
Compose three arrays of values into an array of triples of values. The three
input arrays must have equal length.
- Type Parameters:
A - The type of the first array, and the first element in each triple.B - The type of the second array, and the second element in each triple.C - The type of the third array, and the third element in each triple.- Parameters:
a - Array of the first elements of the resulting triples.b - Array of the second elements of the resulting triples.c - Array of the third elements of the resulting triples.
- Returns:
- An array of triples of values pulled from the specified arrays.
decomposeArrays
public static final <A,B,C,T extends ImmutableTripleInterface<A,B,C>> Triple<A[],B[],C[]> decomposeArrays(T[] t)
- TODO: Javadoc
Decompose an array of triples into a triple of arrays of values.
- Type Parameters:
A - The type of the first array, and the first element in each triple.B - The type of the second array, and the second element in each triple.C - The type of the third array, and the third element in each triple.T - The type of the actual elements in the input array, must extend
ImmutableTripleInterface.- Parameters:
t - An array of triples of values to be put into the resulting arrays.
- Returns:
- A triple of arrays of the values from the specified triples.
equals
public boolean equals(Object o)
- Overrides:
equals in class Pair<A,B>
getC
public C getC()
- Description copied from interface:
ImmutableTripleInterface
- TODO: Javadoc
Get the third element of this triple.
- Specified by:
getC in interface ImmutableTripleInterface<A,B,C>
- Returns:
- The third element of this triple.
hashCode
public int hashCode()
- Overrides:
hashCode in class Pair<A,B>
set
public void set(A _a,
B _b,
C _c)
- Description copied from interface:
TripleInterface
- TODO: Javadoc
- Specified by:
set in interface TripleInterface<A,B,C>
setC
public C setC(C _c)
- Description copied from interface:
TripleInterface
- TODO: Javadoc
Set the third element of this triple.
- Specified by:
setC in interface TripleInterface<A,B,C>
- Parameters:
_c - The new third element of this triple.
- Returns:
- The old third element on this triple.
toString
public String toString()
- Overrides:
toString in class Pair<A,B>