public final class TimedSoftReference<T> extends SoftReference<T>
SoftReference that purges the referent after the given idle time. Idle time in this
case means time without access to the actual referent via get()SoftReference}| Constructor and Description |
|---|
TimedSoftReference(T referent,
long purgeAfterIdleTime)
Creates a new TimedSoftReference object.
|
TimedSoftReference(T referent,
ReferenceQueue<? super T> q,
long purgeAfterIdleTime)
Creates a new TimedSoftReference object.
|
| Modifier and Type | Method and Description |
|---|---|
T |
get()
Gets the actual value of this
SoftReference (the referent). |
clear, enqueue, isEnqueuedpublic TimedSoftReference(T referent, long purgeAfterIdleTime)
new
TimedSoftReference(referent, null, purgeAfterIdleTime)referent - the actual valuepurgeAfterIdleTime - the time after a non-accessed referent will be removed#TimedSoftReference(java.lang.Object, java.lang.ref.ReferenceQueue, long)}public TimedSoftReference(T referent, ReferenceQueue<? super T> q, long purgeAfterIdleTime)
referent - the actual valueq - a reference queue to be usedpurgeAfterIdleTime - the time after a non-accessed referent will be removedSoftReference},
#get()}public T get()
SoftReference (the referent). The actual value may not be present anymore
for reasons explained in SoftReference javadoc or because the value has not been accessed for
purgeAfterIdleTime milliseconds. As soon as the value has been accessed (and the referent is still
existing) the purge operation is rescheduled to take place after purgeAfterIdleTime milliseconds.get in class SoftReference<T>null if it has been cleaned for any reasonSoftReference#get()}Copyright © 2012–2026 cismet GmbH. All rights reserved.