rcf.core.util.reference
Class AtomicReference<T>

java.lang.Object
  extended by rcf.core.util.reference.AtomicReference<T>
All Implemented Interfaces:
rcf.core.concurrent.primitives.Atomic<T>, ImmutableSingletonInterface<T>, SingletonInterface<T>, Reference<T>

@Revision(value="$Revision: 1.1 $",
          date="$Date: 2006/12/02 23:12:43 $",
          tag="$Name:  $")
public class AtomicReference<T>
extends Object
implements Reference<T>, rcf.core.concurrent.primitives.Atomic<T>

TODO: Javadoc

TODO: Unit tests, Code review, Javadoc review, Seal/Finalize TODO: equals, hashCode, toString

Version:
$Revision: 1.1 $
Author:
Greg Gibeling

Nested Class Summary
 
Nested classes/interfaces inherited from interface rcf.core.util.reference.Reference
Reference.Type
 
Field Summary
private  T a
          TODO: Javadoc
private static long offset
          TODO: Javadoc
private static sun.misc.Unsafe unsafe
          TODO: Javadoc
 
Constructor Summary
AtomicReference(T referent)
          TODO: Javadoc
 
Method Summary
 void clear()
          TODO: Javadoc
 boolean compareAndSet(T expect, T t)
           
 boolean enqueue()
          TODO: Javadoc
 boolean equals(Object o)
           
 T get()
          TODO: Javadoc Get the content element of this singleton.
 int hashCode()
           
 boolean isEnqueued()
          TODO: Javadoc
 T set(T _a)
          TODO: Javadoc Set the content element of this singleton.
 Reference.Type type()
          TODO: Javadoc
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

unsafe

private static final sun.misc.Unsafe unsafe
TODO: Javadoc


offset

private static final long offset
TODO: Javadoc


a

private volatile T a
TODO: Javadoc

Constructor Detail

AtomicReference

public AtomicReference(T referent)
TODO: Javadoc

Parameters:
referent -
Method Detail

clear

public void clear()
Description copied from interface: Reference
TODO: Javadoc

Specified by:
clear in interface Reference<T>

compareAndSet

public boolean compareAndSet(T expect,
                             T t)
Specified by:
compareAndSet in interface rcf.core.concurrent.primitives.Atomic<T>

enqueue

public boolean enqueue()
Description copied from interface: Reference
TODO: Javadoc

Specified by:
enqueue in interface Reference<T>
Returns:

equals

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

get

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

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

isEnqueued

public boolean isEnqueued()
Description copied from interface: Reference
TODO: Javadoc

Specified by:
isEnqueued in interface Reference<T>
Returns:

set

public T set(T _a)
Description copied from interface: SingletonInterface
TODO: Javadoc Set the content element of this singleton.

Specified by:
set in interface SingletonInterface<T>
Parameters:
_a - The new content element of this singleton.
Returns:
The old content element of this singleton.

type

public Reference.Type type()
Description copied from interface: Reference
TODO: Javadoc

Specified by:
type in interface Reference<T>
Returns: