org.apache.openjpa.lib.util
Interface SizedMap

All Superinterfaces:
Map
All Known Implementing Classes:
ConcurrentReferenceHashMap, LRUMap, ReferenceHashMap, SizedConcurrentHashMap

public interface SizedMap
extends Map

A Map type that maintains a maximum size, automatically removing entries when the maximum is exceeded.

Author:
Abe White

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Method Summary
 int getMaxSize()
          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, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Method Detail

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

void overflowRemoved(Object key,
                     Object value)
Overridable callback for when an overflow entry is automatically removed.



Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.