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 ISimpleMap
public void discard()
discard
in interface IDiscardable
public Object get(Object key)
get
in interface ISimpleMap
key
- no descriptionnull
public long getGenerationTime()
getGenerationTime
in interface IGenerationCache
public void put(Object key, Object value)
put
in interface ISimpleMap
key
- for lookup of valuevalue
- to place in cachepublic void remove(Object key)
remove
in interface ISimpleMap
key
- the key which shall be removedpublic void setGenerationTime(long generationTime)
setGenerationTime
in interface IGenerationCache
generationTime
- to setAccess 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 2018 SAP AG Complete Copyright Notice