IT. Expert System.

Android Reference

ThreadLocal


java.lang

Class ThreadLocal<T>

  • Direct Known Subclasses:
    InheritableThreadLocal


    public class ThreadLocal<T>
    extends Object
    Implements a thread-local storage, that is, a variable for which each thread has its own value. All threads share the same ThreadLocal object, but each sees a different value when accessing it, and changes made by one thread do not affect the other threads. The implementation supports null values.
    See Also:
    Thread
    • Constructor Summary

      Constructors
      Constructor and Description
      ThreadLocal()
      Creates a new thread-local variable.
    • Constructor Detail

      • ThreadLocal

        public ThreadLocal()
        Creates a new thread-local variable.
    • Method Detail

      • get

        public T get()
        Returns the value of this variable for the current thread. If an entry doesn't yet exist for this variable on this thread, this method will create an entry, populating the value with the result of initialValue().
        Returns:
        the current value of the variable for the calling thread.
      • initialValue

        protected T initialValue()
        Provides the initial value of this variable for the current thread. The default implementation returns null.
        Returns:
        the initial value of the variable.
      • set

        public void set(T value)
        Sets the value of this variable for the current thread. If set to null, the value will be set to null and the underlying entry will still be present.
        Parameters:
        value - the new value of the variable for the caller thread.
      • remove

        public void remove()
        Removes the entry for this variable in the current thread. If this call is followed by a get() before a set(T), #get() will call initialValue() and create a new entry with the resulting value.
        Since:
        1.5


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 2186 / . Delta: 0.02428 с