|
Knopflerfish OSGi 1.3.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knopflerfish.util.CachedObject
An object with a timeout.
A CachedObject has a timeout period -
during that period the get
method will return the
stored object, afterwards get
will return
null
CacheMap
Field Summary | |
static long |
DEFAULT_TIMEOUT
Default timeout period in milliseconds. |
Constructor Summary | |
CachedObject()
Equivalent to CachedObject(null) . |
|
CachedObject(java.lang.Object object)
Equivalent to CachedObject(object, CachedObject.DEFAULT_TIMEOUT) |
|
CachedObject(java.lang.Object object,
long timeout)
Create a cached object from an object and a specified timeout. |
Method Summary | |
void |
flush()
Clear the stored object. |
java.lang.Object |
get()
Get the cached object. |
void |
set(java.lang.Object object)
Set the cache's object and restore its creation time. |
java.lang.String |
toString()
Print the cached object as "<object's string value>:<remaining time in milliseconds>" |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final long DEFAULT_TIMEOUT
Constructor Detail |
public CachedObject()
CachedObject(null)
.
CacheMap
public CachedObject(java.lang.Object object)
CachedObject(object, CachedObject.DEFAULT_TIMEOUT)
DEFAULT_TIMEOUT
public CachedObject(java.lang.Object object, long timeout)
object
- Object to cachetimeout
- period in milliseconds.DEFAULT_TIMEOUT
Method Detail |
public void set(java.lang.Object object)
object
- Object to cachepublic java.lang.Object get()
null
afterwards.public void flush()
get
will
public java.lang.String toString()
|
Knopflerfish OSGi 1.3.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |