|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Cache
Method Summary | |
---|---|
void |
clear()
Removes all data coneined in this Cache |
CacheValue |
get(CacheKey cacheKey)
Retrieves the CacheValue previously stored using the given cacheKey . |
CacheValue |
get(CacheKey cacheKey,
boolean includeInvalid)
Retrieves the CacheValue previously stored using the given cacheKey . |
Set<CacheKey> |
keySet()
Returns Set of CacheKey contained in this Cache |
void |
put(CacheKey cacheKey,
CacheValue cacheValue)
Stores the given cacheValue at the given cacheKey . |
boolean |
remove(CacheKey cacheKey)
Removes that CacheKey from this Cache. |
Method Detail |
---|
void put(CacheKey cacheKey, CacheValue cacheValue)
cacheValue
at the given cacheKey
.cacheKey
it will be replaced.CacheKey
s represent the same data is ultimately depending on the implementation, but usually relies on the
equals
an/or hashcode
methods.
cacheKey
- The CacheKey
to be used for storing.cacheValue
- The CacheValue
to be stored.CacheValue get(CacheKey cacheKey)
CacheValue
previously stored using the given cacheKey
.cacheKey
is not stored in this Cache
this method will return null
.Cache
will check if the stored CacheValue
is still valid (using the
CacheValue.isValid(CacheKey)
method). If the CacheValue
is considered to be invalid this method will return
null
as well (indicating that no valid CacheValue
is available).get(CacheKey, boolean)
method.
cacheKey
- The CacheKey
defining which CacheValue
to retrieve.
CacheValue
or null
if no or no valid CacheValue
is stored at the
given cacheValue
.CacheValue get(CacheKey cacheKey, boolean includeInvalid)
CacheValue
previously stored using the given cacheKey
.cacheKey
is not stored in this Cache
this method will return null
.includeInvalid
is true
(i.e. the returned CacheValue
might be invalid in this case).
cacheKey
- The CacheKey
defining which CacheValue
to retrieve.includeInvalid
- Defines whether invalid CacheValue
should be returned or not. Using true
will also
return invalid CacheValue
. Using false
will yield the same results as get(CacheKey)
.
CacheValue
or null
if and only if no CacheValue
is stored at the
given cacheValue
.Set<CacheKey> keySet()
Set
of CacheKey
contained in this Cache
boolean remove(CacheKey cacheKey)
cacheKey
- void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |