rcf.core.util.groups
Class ImmutablePair<A,B>
java.lang.Object
rcf.core.util.groups.ImmutableSingleton<A>
rcf.core.util.groups.ImmutablePair<A,B>
- Type Parameters:
A - The type of the first entry in each pair.B - The type of the second entry in each pair.
- All Implemented Interfaces:
- ImmutablePairInterface<A,B>, ImmutableSingletonInterface<A>
- Direct Known Subclasses:
- ImmutablePair.Accessor, ImmutablePair.Iterable, ImmutableTriple, Pair.Iterable
@Revision(value="$Revision: 1.29 $",
date="$Date: 2006/11/14 15:47:40 $",
tag="$Name: $")
public class ImmutablePair<A,B>- extends ImmutableSingleton<A>
- implements ImmutablePairInterface<A,B>
TODO: Javadoc
Provides a simple, type safe (generic) wrapper which can encapsulate a pair of
references. This is effectively a multi-type, type safe limited length array.
- Version:
- $Revision: 1.29 $
- Author:
- Greg Gibeling
|
Nested Class Summary |
static class |
ImmutablePair.Accessor<A,B>
TODO: Javadoc
Binds a pair of accessors to form a pair accessor. |
static class |
ImmutablePair.Iterable<A,B>
TODO: Javadoc
Binds a pair of immutable iterable objects, allowing them to be iterated
in tandem. |
static class |
ImmutablePair.Iterator<A,B>
TODO: Javadoc
Binds a pair of immutable iterators, allowing them to be iterated in tandem. |
|
Field Summary |
protected B |
b
TODO: Javadoc The second object to store. |
|
Constructor Summary |
ImmutablePair(A _a,
B _b)
TODO: Javadoc
Base constructor, simply records the elements for this object. |
b
protected final B b
- TODO: Javadoc The second object to store.
ImmutablePair
public ImmutablePair(A _a,
B _b)
- TODO: Javadoc
Base constructor, simply records the elements for this object.
- Parameters:
_a - The first object to store._b - The second object to store.
equals
public boolean equals(Object o)
- Overrides:
equals in class ImmutableSingleton<A>
getA
public A getA()
- Description copied from interface:
ImmutablePairInterface
- TODO: Javadoc
Get the first element of this pair.
- Specified by:
getA in interface ImmutablePairInterface<A,B>
- Returns:
- The first element of this pair.
- See Also:
ImmutableSingletonInterface.get()
getB
public B getB()
- Description copied from interface:
ImmutablePairInterface
- TODO: Javadoc
Get the second element of this pair.
- Specified by:
getB in interface ImmutablePairInterface<A,B>
- Returns:
- The second element of this pair.
hashCode
public int hashCode()
- Overrides:
hashCode in class ImmutableSingleton<A>
toString
public String toString()
- Overrides:
toString in class ImmutableSingleton<A>