net.ontopia.utils
Class HistoryMap
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap
net.ontopia.utils.HistoryMap
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.util.Map
public class HistoryMap
- extends java.util.HashMap
INTERNAL: Helper class for storing elements up to a certain amount,
lower most elements will be removed to ensure a fixed size of the
collection.
- Since:
- 1.2.5
- See Also:
- Serialized Form
Constructor Summary |
HistoryMap()
Default constructor which uses 20 entries as the default history
size and does suppress duplicates. |
HistoryMap(int maxEntries,
boolean suppressDuplicates)
Constructor which allows to specify number of entries to store and
duplicate suppression behaviour. |
Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
HistoryMap
public HistoryMap()
- Default constructor which uses 20 entries as the default history
size and does suppress duplicates.
HistoryMap
public HistoryMap(int maxEntries,
boolean suppressDuplicates)
- Constructor which allows to specify number of entries to store and
duplicate suppression behaviour.
- Parameters:
maxEntries
- Maxium number of entries to store in the history.suppressDuplicates
- Should suppress duplicate entries in map.
getMaxEntries
public int getMaxEntries()
doesSuppressDuplicates
public boolean doesSuppressDuplicates()
add
public void add(java.lang.Object obj)
removeEntry
public void removeEntry(java.lang.Object obj)
getEntry
public java.lang.Object getEntry(int index)
getEntries
public java.util.Collection getEntries()
getEntriesReverse
public java.util.Collection getEntriesReverse()
Copyright © 2000-2010 Ontopia.