Interface BidirectionalObjectToIdMap<V>
- All Known Implementing Classes:
BidirectionalObjectToIdMapDefault, BidirectionalObjectToIdMapIdentity, FrequencyGatedBidirectionalObjectToIdMap
public interface BidirectionalObjectToIdMap<V>
-
Method Summary
Modifier and TypeMethodDescriptiongetIdByValue(V value) Returns the id for the given value or null if the value is not mapped.getValueById(int id) Returns the value mapped to the given id or null if there is no such mapping.insertNewEntryOnRead(int id, V value) Inserts a new entry mapping the given id to the given value.insertNewEntryOnWrite(V value) Inserts a new entry mapping an id to the given value.
-
Method Details
-
getIdByValue
Returns the id for the given value or null if the value is not mapped. -
insertNewEntryOnWrite
Inserts a new entry mapping an id to the given value. Reuses an id freed by LRU eviction when the map is at capacity; otherwise assigns the next unused id. Returns the assigned id. -
insertNewEntryOnRead
Inserts a new entry mapping the given id to the given value.Any existing entry with the same value if removed from the valueToId map.
Returns the existing value mapped to the given id or null if there was no existing mapping. -
getValueById
Returns the value mapped to the given id or null if there is no such mapping.
-