Interface Cache<K,V>
-
- All Known Implementing Classes:
CacheAccessTracker
,RecordCache
public interface Cache<K,V>
Partial mapping of keys of typeK
to values of typeCache
. If supported by the underlying implementation the mappings can further be associated with a cost, which is a metric for the cost occurring when the given mapping is lost. Higher values represent higher costs.
-
-
Method Detail
-
put
void put(@NotNull K key, @NotNull V value)
Add a mapping fromkey
tovalue
.- Throws:
UnsupportedOperationException
- if the underlying implementation doesn't support values without an associated cost andput(Object, Object, byte)
should be used instead.
-
put
void put(@NotNull K key, @NotNull V value, byte cost)
Add a mapping fromkey
tovalue
with a givencost
.- Throws:
UnsupportedOperationException
- if the underlying implementation doesn't support values with an associated cost andput(Object, Object)
should be used instead.
-
-