Interface Cache<K,V>
-
- All Known Implementing Classes:
CacheAccessTracker,RecordCache
public interface Cache<K,V>Partial mapping of keys of typeKto 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 fromkeytovalue.- 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 fromkeytovaluewith a givencost.- Throws:
UnsupportedOperationException- if the underlying implementation doesn't support values with an associated cost andput(Object, Object)should be used instead.
-
-