public class DiscardingCache extends Object implements IGenerationCache, IDiscardable
IGenerationCache for all kinds of Java objects.
DiscardingCache honors the IDiscardable interface. Objects placed
in the cache will be checked for implementing IDiscardable before
removing them from the cache.
DiscardingCache is multithread-safe.
Copyright (c) SAP AG 2001-2004
| Constructor and Description |
|---|
DiscardingCache(long generationTime)
Construct a new Cache with the given time between generations
|
DiscardingCache(long generationTime,
Map map1,
Map map2)
Construct a new Cache with the given time between generations
and the given Maps for the two generations.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Remove all entries from the cache
|
void |
discard()
This cache itself has been discarded.
|
Object |
get(Object key)
Retrieve the value for the given key
|
long |
getGenerationTime() |
void |
put(Object key,
Object value)
Put the value in the cache under the given key
|
void |
remove(Object key)
Remove the given key and its value from the cache.
|
void |
setGenerationTime(long generationTime)
Adjust the generation time of this cache.
|
public DiscardingCache(long generationTime)
generationTime - time in millisecondspublic DiscardingCache(long generationTime,
Map map1,
Map map2)
generationTime - time in millisecondsmap1 - map for a generationmap2 - map for a generationpublic void clear()
clear in interface ISimpleMappublic void discard()
discard in interface IDiscardablepublic Object get(Object key)
get in interface ISimpleMapkey - no descriptionnullpublic long getGenerationTime()
getGenerationTime in interface IGenerationCachepublic void put(Object key, Object value)
put in interface ISimpleMapkey - for lookup of valuevalue - to place in cachepublic void remove(Object key)
remove in interface ISimpleMapkey - the key which shall be removedpublic void setGenerationTime(long generationTime)
setGenerationTime in interface IGenerationCachegenerationTime - to set| Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] KMC-CM
|
[sap.com] tc/km/frwk
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
Copyright 2021 SAP SE Complete Copyright Notice