|
Knopflerfish OSGi 5.2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.knopflerfish.util.CachedObject<V>
public class CachedObject<V>
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(V object)
Equivalent to CachedObject(object, CachedObject.DEFAULT_TIMEOUT) |
|
CachedObject(V object,
long timeout)
Create a cached object from an object and a specified timeout. |
|
| Method Summary | |
|---|---|
void |
flush()
Clear the stored object. |
V |
get()
Get the cached object. |
void |
set(V 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).
CacheMappublic CachedObject(V object)
CachedObject(object, CachedObject.DEFAULT_TIMEOUT)
DEFAULT_TIMEOUT
public CachedObject(V object,
long timeout)
object - Object to cachetimeout - period in milliseconds.DEFAULT_TIMEOUT| Method Detail |
|---|
public void set(V object)
object - Object to cachepublic V get()
null
afterwards.public void flush()
get will
public java.lang.String toString()
toString in class java.lang.Object
|
Knopflerfish OSGi 5.2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||