Package com.ibm.icu.impl
Class CacheValue.NullValue<V>
- java.lang.Object
-
- com.ibm.icu.impl.CacheValue<V>
-
- com.ibm.icu.impl.CacheValue.NullValue<V>
-
- Enclosing class:
- CacheValue<V>
private static final class CacheValue.NullValue<V> extends CacheValue<V>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.ibm.icu.impl.CacheValue
CacheValue.Strength
-
-
Constructor Summary
Constructors Modifier Constructor Description private
NullValue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description V
get()
Returns the value (which can be null), or null if it was held in a Reference and has been cleared.boolean
isNull()
Distinguishes a null value from a Reference value that has been cleared.V
resetIfCleared(V value)
If the value was held via aReference
which has been cleared, then it is replaced with a newReference
to the new value, and the new value is returned.-
Methods inherited from class com.ibm.icu.impl.CacheValue
futureInstancesWillBeStrong, getInstance, setStrength
-
-
-
-
Method Detail
-
isNull
public boolean isNull()
Description copied from class:CacheValue
Distinguishes a null value from a Reference value that has been cleared.- Overrides:
isNull
in classCacheValue<V>
- Returns:
- true if this object represents a null value.
-
get
public V get()
Description copied from class:CacheValue
Returns the value (which can be null), or null if it was held in a Reference and has been cleared.- Specified by:
get
in classCacheValue<V>
-
resetIfCleared
public V resetIfCleared(V value)
Description copied from class:CacheValue
If the value was held via aReference
which has been cleared, then it is replaced with a newReference
to the new value, and the new value is returned. The old and new values should be the same or equivalent.Otherwise the old value is returned.
- Specified by:
resetIfCleared
in classCacheValue<V>
- Parameters:
value
- Replacement value, for when the currentReference
has been cleared.- Returns:
- The old or new value.
-
-