org.apache.openjpa.lib.util
Class ReferenceHashMap
java.lang.Object
   java.util.AbstractMap
java.util.AbstractMap
       org.apache.commons.collections.map.AbstractHashedMap
org.apache.commons.collections.map.AbstractHashedMap
           org.apache.commons.collections.map.AbstractReferenceMap
org.apache.commons.collections.map.AbstractReferenceMap
               org.apache.commons.collections.map.ReferenceMap
org.apache.commons.collections.map.ReferenceMap
                   org.apache.openjpa.lib.util.ReferenceHashMap
org.apache.openjpa.lib.util.ReferenceHashMap
- All Implemented Interfaces: 
- Serializable, Map, IterableMap, ReferenceMap, SizedMap
- public class ReferenceHashMap 
- extends ReferenceMap- implements ReferenceMap, SizedMap
Map in which the key, value, or both may be weak/soft references.
- Since:
- 0.4.0
- Author:
- Abe White
- See Also:
- Serialized Form
 
 
 
| Nested classes/interfaces inherited from interface java.util.Map | 
| Map.Entry<K,V> | 
 
| Nested classes/interfaces inherited from interface java.util.Map | 
| Map.Entry<K,V> | 
 
 
 
| Fields inherited from class org.apache.commons.collections.map.AbstractHashedMap | 
| data, DEFAULT_CAPACITY, DEFAULT_LOAD_FACTOR, DEFAULT_THRESHOLD, entrySet, GETKEY_INVALID, GETVALUE_INVALID, keySet, loadFactor, MAXIMUM_CAPACITY, modCount, NO_NEXT_ENTRY, NO_PREVIOUS_ENTRY, NULL, REMOVE_INVALID, SETVALUE_INVALID, size, threshold, values | 
 
 
 
 
| Methods inherited from class org.apache.commons.collections.map.AbstractReferenceMap | 
| clear, containsKey, containsValue, createEntrySetIterator, createKeySetIterator, createValuesIterator, entrySet, get, getEntry, hashEntry, init, isEmpty, isEqualKey, keySet, mapIterator, purge, purgeBeforeRead, purgeBeforeWrite, put, remove, size, values | 
 
| Methods inherited from class org.apache.commons.collections.map.AbstractHashedMap | 
| addEntry, calculateNewCapacity, calculateThreshold, checkCapacity, clone, convertKey, destroyEntry, ensureCapacity, entryHashCode, entryKey, entryNext, entryValue, equals, hash, hashCode, hashIndex, isEqualValue, putAll, removeEntry, removeMapping, reuseEntry, toString, updateEntry | 
 
 
| Methods inherited from interface java.util.Map | 
| clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values | 
 
| Methods inherited from interface java.util.Map | 
| clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values | 
 
ReferenceHashMap
public ReferenceHashMap(int keyType,
                        int valueType)
ReferenceHashMap
public ReferenceHashMap(int keyType,
                        int valueType,
                        int capacity,
                        float loadFactor)
getMaxSize
public int getMaxSize()
- Description copied from interface: SizedMap
- The maximum number of entries, or Integer.MAX_VALUE for no limit.
 
- 
- Specified by:
- getMaxSizein interface- SizedMap
 
- 
 
setMaxSize
public void setMaxSize(int maxSize)
- Description copied from interface: SizedMap
- The maximum number of entries, or Integer.MAX_VALUE for no limit.
 
- 
- Specified by:
- setMaxSizein interface- SizedMap
 
- 
 
isFull
public boolean isFull()
- Description copied from interface: SizedMap
- Whether the map is full.
 
- 
- Specified by:
- isFullin interface- SizedMap
 
- 
 
overflowRemoved
public void overflowRemoved(Object key,
                            Object value)
- Description copied from interface: SizedMap
- Overridable callback for when an overflow entry is automatically removed.
 
- 
- Specified by:
- overflowRemovedin interface- SizedMap
 
- 
 
valueExpired
public void valueExpired(Object key)
- Description copied from interface: ReferenceMap
- Overridable callback for when a value reference expires.
 
- 
- Specified by:
- valueExpiredin interface- ReferenceMap
 
- 
- Parameters:
- key- the key for the expired value
 
keyExpired
public void keyExpired(Object value)
- Description copied from interface: ReferenceMap
- Overridable callback for when a key reference expires.
 
- 
- Specified by:
- keyExpiredin interface- ReferenceMap
 
- 
- Parameters:
- value- the value for the expired key
 
removeExpired
public void removeExpired()
- Description copied from interface: ReferenceMap
- Purge stale entries.
 
- 
- Specified by:
- removeExpiredin interface- ReferenceMap
 
- 
 
addMapping
protected void addMapping(int hashIndex,
                          int hashCode,
                          Object key,
                          Object value)
- 
- Overrides:
- addMappingin class- AbstractHashedMap
 
- 
 
createEntry
protected AbstractHashedMap.HashEntry createEntry(AbstractHashedMap.HashEntry next,
                                                  int hashCode,
                                                  Object key,
                                                  Object value)
- 
- Overrides:
- createEntryin class- AbstractReferenceMap
 
- 
 
purge
protected void purge(Reference ref)
- 
- Overrides:
- purgein class- AbstractReferenceMap
 
- 
 
doWriteObject
protected void doWriteObject(ObjectOutputStream out)
                      throws IOException
- 
- Overrides:
- doWriteObjectin class- AbstractReferenceMap
 
- 
- Throws:
- IOException
 
doReadObject
protected void doReadObject(ObjectInputStream in)
                     throws ClassNotFoundException,
                            IOException
- 
- Overrides:
- doReadObjectin class- AbstractReferenceMap
 
- 
- Throws:
- ClassNotFoundException
- IOException
 
Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.