|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrcf.core.util.groups.Singleton<A>
@Revision(value="$Revision: 1.29 $",
date="$Date: 2006/11/09 02:10:10 $",
tag="$Name: $")
public class Singleton<A>
TODO: Javadoc
Provides a simple, type safe (generic) wrapper which can encapsulate a single
reference. Alone this class is pratically useless, as it provides no benefit
above a simple reference. However in conjunction with the
rcf.core.util.collection.position package or the Pair class,
this class provides a vital base.
| Nested Class Summary | |
|---|---|
static class |
Singleton.Iterable<A>
TODO: Javadoc Wrap a single iterable collection, create an iterable over singletons of elements. |
static class |
Singleton.Iterator<A>
TODO: Javadoc Wrap a single iterator, create an iterator over singletons of elements. |
| Field Summary | |
|---|---|
protected A |
a
TODO: Javadoc The content element to store. |
| Constructor Summary | |
|---|---|
Singleton(A _a)
TODO: Javadoc Base constructor, simply records the content element for this object. |
|
| Method Summary | ||
|---|---|---|
static
|
composeArrays(A[] a)
TODO: Javadoc Compose an array of values into an array of singletons. |
|
static
|
decomposeArrays(S[] s)
TODO: Javadoc Decompose an array of singletons into an array of values. |
|
boolean |
equals(Object o)
|
|
A |
get()
TODO: Javadoc Get the content element of this singleton. |
|
int |
hashCode()
|
|
A |
set(A _a)
TODO: Javadoc Set the content element of this singleton. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected A a
| Constructor Detail |
|---|
public Singleton(A _a)
_a - The content element to store.| Method Detail |
|---|
public static final <A> Singleton<A>[] composeArrays(A[] a)
A - The type of the elements in the array, and the content element
in each singleton.a - Array of the content elements of the resulting singletons.
public static final <A,S extends ImmutableSingletonInterface<A>> A[] decomposeArrays(S[] s)
A - The type of the elements in the array, and the content element
in each singleton.S - The type of the actual elements in the input array. Must
extend ImmutableSingletonInterface.s - An array of singletons of values to be put into the resulting
array.
public boolean equals(Object o)
equals in class Objectpublic A get()
ImmutableSingletonInterface
get in interface ImmutableSingletonInterface<A>public int hashCode()
hashCode in class Objectpublic A set(A _a)
SingletonInterface
set in interface SingletonInterface<A>_a - The new content element of this singleton.
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||