javolution.context
Class AllocatorContext.Reference<T>

Object
  extended by AllocatorContext.Reference<T>
All Implemented Interfaces:
Reference<T>
Enclosing class:
AllocatorContext

public static class AllocatorContext.Reference<T>
extends Object
implements Reference<T>

This class represents a reference allocated from the current AllocatorContext. The reachability level of this reference is the scope of the AllocatorContext in which it has been created.

Version:
5.0, April 14, 2007
Author:
Jean-Marie Dautelle

Constructor Summary
AllocatorContext.Reference()
          Default constructor.
 
Method Summary
 T get()
          Returns the value this reference referes to.
static
<T> AllocatorContext.Reference<T>
newInstance()
          Returns a new stack reference instance allocated on the current stack when executing in a StackContext.
 void set(T value)
          Sets the value this reference referes to.
 String toString()
          Returns the string representation of the current value of this reference.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AllocatorContext.Reference

public AllocatorContext.Reference()
Default constructor.

Method Detail

newInstance

public static <T> AllocatorContext.Reference<T> newInstance()
Returns a new stack reference instance allocated on the current stack when executing in a StackContext.

Returns:
a reference object possibly recycled.

toString

public String toString()
Returns the string representation of the current value of this reference.

Overrides:
toString in class Object
Returns:
String.valueOf(this.get())

get

public final T get()
Description copied from interface: Reference
Returns the value this reference referes to.

Specified by:
get in interface Reference<T>
Returns:
the referent or null if not set.

set

public final void set(T value)
Description copied from interface: Reference
Sets the value this reference referes to.

Specified by:
set in interface Reference<T>
Parameters:
value - the reference value.


Copyright © 2005-2012 Javolution. All Rights Reserved.