API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.lang. ThreadLocal View Source
Author(s)
Josh Bloch and Doug Lea
Since
1.2
Version
1.42, 06/23/06
Serial
Hierarchy
 Object
      ThreadLocal
Implements
Subclasses
Description
public class ThreadLocal
  This class provides thread-local variables.
See also:   
Constructors
public ThreadLocal ()
Creates a thread local variable.
Methods
Hide/Show inherited methods
pack-private T childValue ( T parentValue)
  Method childValue is visibly defined in subclass InheritableThreadLocal, but is internally defined here for the sake of providing createInheritedMap factory method without needing to subclass the map class in InheritableThreadLocal.
pack-privatestatic ThreadLocalMap createInheritedMap (ThreadLocalMap parentMap)
  Factory method to create map of inherited thread locals.
pack-private void createMap (Thread t, T firstValue)
  Create the map associated with a ThreadLocal.
public T get ()
  Returns the value in the current thread's copy of this thread-local variable.
pack-private ThreadLocalMap getMap (Thread t)
  Get the map associated with a ThreadLocal.
protected T initialValue ()
  Returns the current thread's "initial value" for this thread-local variable.
public void remove ()
  Removes the current thread's value for this thread-local variable.
public void set ( T value)
  Sets the current thread's copy of this thread-local variable to the specified value.
Fields
Hide/Show inherited fields
Nested Classes
  ThreadLocal.ThreadLocalMap
ThreadLocalMap is a customized hash map suitable only for maintaining thread local values.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar