Spec-Zone .ru
спецификации, руководства, описания, API
|
|
Java™ Platform Standard Ed. 7 DRAFT ea-b118 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.dyn.ClassValue<T>
public abstract class ClassValue<T> extends Object
Lazily associate a computed value with (potentially) every class.
Modifier | Constructor and Description |
---|---|
protected |
ClassValue()
Creates a new class value. |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
computeValue(Class<?> type)
Compute the given class's derived value for this ClassValue . |
T |
get(Class<?> type)
Returns the value for the given class. |
int |
hashCode()
The hash code for this type is based on the identity of the object, and is well-dispersed for power-of-two tables. |
void |
remove(Class<?> type)
Removes the associated value for the given class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ClassValue()
Method Detail |
---|
protected abstract T computeValue(Class<?> type)
ClassValue
.
This method will be invoked within the first thread that accesses
the value with the get(java.lang.Class<?>)
.
Normally, this method is invoked at most once per class,
but it may be invoked again in case of subsequent invocations
of remove(java.lang.Class<?>)
followed by get(java.lang.Class<?>)
.
public T get(Class<?> type)
computeValue(java.lang.Class<?>)
method.
The actual installation of the value on the class is performed while the class's synchronization lock is held. At that point, if racing threads have computed values, one is chosen, and returned to all the racing threads.
public void remove(Class<?> type)
computeValue(java.lang.Class<?>)
method.
This may result in an additional invocation of the
computeValue
method for the given class.
public final int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
|
Java™ Platform Standard Ed. 7 DRAFT ea-b118 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1993, 2010, Oracle Corporation. All rights reserved.