public class ForeverCache<KeyType extends Serializable,ValueType extends Serializable> extends Object implements Cache<KeyType,ValueType>
Constructor and Description |
---|
ForeverCache()
Constructs the cache.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all entries from the cache.
|
ValueType |
get(KeyType aKey)
Retrieves a value from the cache.
|
void |
put(KeyType aKey,
ValueType aValue)
Adds a key-value pair to the cache.
|
void |
remove(KeyType aKey)
Removes an entry from the cache.
|
public void put(KeyType aKey, ValueType aValue)
Cache
put
in interface Cache<KeyType extends Serializable,ValueType extends Serializable>
aKey
- Key.aValue
- Value.public ValueType get(KeyType aKey)
Cache
get
in interface Cache<KeyType extends Serializable,ValueType extends Serializable>
aKey
- Key to retrieve.public void remove(KeyType aKey)
Cache
remove
in interface Cache<KeyType extends Serializable,ValueType extends Serializable>
aKey
- Key to remove the entry for.public void clear()
Cache
clear
in interface Cache<KeyType extends Serializable,ValueType extends Serializable>
Copyright © 2024. All rights reserved.