public abstract class Descriptor
extends java.lang.Object
| Constructor and Description |
|---|
Descriptor() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isNew()
Permits to know if this object was ever used before.
|
boolean |
isValid()
Checks if this descriptor is still valid.
|
boolean |
isValid(long currentTime)
Checks if this descriptor is still valid.
|
static void |
setTimeBeforeRemoval(long timeBeforeRemoval)
Set the time of validation of the cache.
|
abstract void |
update()
Updates this Descriptor.
|
void |
use()
Marks this descriptors' last usage as now.
|
public static void setTimeBeforeRemoval(long timeBeforeRemoval)
timeBeforeRemoval - the time of validation, in milliseconds.public boolean isValid(long currentTime)
currentTime - the current time in milliseconds, as provided by System.currentTimeMillis().true if this descriptor is valid.Shortcut without the currentTime parameterpublic final boolean isValid()
true if this descriptor is valid.For large collectionspublic final boolean isNew()
This method tracks whether use() was ever called on this object (except by the initializer).
true if this object has already been used at least once.public final void use()
public abstract void update()
The update is always executed in the current thread.