Package org.apache.openjpa.lib.util
Interface SizedMap
- All Superinterfaces:
Map
- All Known Implementing Classes:
ConcurrentHashMap
,ConcurrentReferenceHashMap
,LRUMap
,ReferenceHashMap
A
Map
type that maintains a maximum size, automatically
removing entries when the maximum is exceeded.- Author:
- Abe White
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
The maximum number of entries, or Integer.MAX_VALUE for no limit.boolean
isFull()
Whether the map is full.void
overflowRemoved
(Object key, Object value) Overridable callback for when an overflow entry is automatically removed.void
setMaxSize
(int max) The maximum number of entries, or Integer.MAX_VALUE for no limit.Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Method Details
-
getMaxSize
int getMaxSize()The maximum number of entries, or Integer.MAX_VALUE for no limit. -
setMaxSize
void setMaxSize(int max) The maximum number of entries, or Integer.MAX_VALUE for no limit. -
isFull
boolean isFull()Whether the map is full. -
overflowRemoved
Overridable callback for when an overflow entry is automatically removed.
-