rcf.core.util.groups
Class ImmutableSingleton<A>

java.lang.Object
  extended by rcf.core.util.groups.ImmutableSingleton<A>
Type Parameters:
A - The type of the content element in each singleton.
All Implemented Interfaces:
ImmutableSingletonInterface<A>
Direct Known Subclasses:
GUIHelpers.WindowCloserFrameworkEventSink, ImmutablePair, ImmutableSingleton.Accessor, ImmutableSingleton.Iterable, Singleton.Iterable

@Revision(value="$Revision: 1.27 $",
          date="$Date: 2006/11/14 15:47:41 $",
          tag="$Name:  $")
public class ImmutableSingleton<A>
extends Object
implements ImmutableSingletonInterface<A>

TODO: Javadoc Provides a simple, type safe (generic) wrapper which can encapsulate a single reference. Alone this class is practically useless, as it provides no benefit above a simple final reference. However in conjunction with the rcf.core.util.collection.position package or the ImmutablePair class, this class provides a vital base.

Version:
$Revision: 1.27 $
Author:
Greg Gibeling

Nested Class Summary
static class ImmutableSingleton.Accessor<A>
          TODO: Javadoc Wrap an accessor to form an accessor which will operate over singletons.
static class ImmutableSingleton.Iterable<A>
          TODO: Javadoc Wrap a single immutable iterable collection, create an immutable iterable over singletons of elements.
static class ImmutableSingleton.Iterator<A>
          TODO: Javadoc Wrap a single immutable iterator, create an immutable iterator over singletons of elements.
 
Field Summary
protected  A a
          TODO: Javadoc The content element to store.
 
Constructor Summary
ImmutableSingleton(A _a)
          TODO: Javadoc Base constructor, simply records the content element for this object.
 
Method Summary
 boolean equals(Object o)
           
 A get()
          TODO: Javadoc Get the content element of this singleton.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

a

protected final A a
TODO: Javadoc The content element to store.

Constructor Detail

ImmutableSingleton

public ImmutableSingleton(A _a)
TODO: Javadoc Base constructor, simply records the content element for this object.

Parameters:
_a - The content element to store.
Method Detail

equals

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

get

public A get()
Description copied from interface: ImmutableSingletonInterface
TODO: Javadoc Get the content element of this singleton.

Specified by:
get in interface ImmutableSingletonInterface<A>
Returns:
The content element of this singleton.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object