|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.collections.map.ReferenceMap
org.apache.openjpa.lib.util.ReferenceHashMap
public class ReferenceHashMap
Map in which the key, value, or both may be weak/soft references.
| Nested Class Summary |
|---|
| 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> |
| Field Summary |
|---|
| Fields inherited from interface org.apache.openjpa.lib.util.ReferenceMap |
|---|
HARD, SOFT, WEAK |
| Constructor Summary | |
|---|---|
ReferenceHashMap(int keyType,
int valueType)
|
|
ReferenceHashMap(int keyType,
int valueType,
int capacity,
float loadFactor)
|
|
| Method Summary | |
|---|---|
protected void |
addMapping(int hashIndex,
int hashCode,
Object key,
Object value)
|
protected HashEntry |
createEntry(HashEntry next,
int hashCode,
Object key,
Object value)
|
protected void |
doReadObject(ObjectInputStream in)
|
protected void |
doWriteObject(ObjectOutputStream out)
|
int |
getMaxSize()
The maximum number of entries, or Integer.MAX_VALUE for no limit. |
boolean |
isFull()
Whether the map is full. |
void |
keyExpired(Object value)
Overridable callback for when a key reference expires. |
void |
overflowRemoved(Object key,
Object value)
Overridable callback for when an overflow entry is automatically removed. |
protected void |
purge(Reference ref)
|
void |
removeExpired()
Purge stale entries. |
void |
setMaxSize(int maxSize)
The maximum number of entries, or Integer.MAX_VALUE for no limit. |
void |
valueExpired(Object key)
Overridable callback for when a value reference expires. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 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 |
| Constructor Detail |
|---|
public ReferenceHashMap(int keyType,
int valueType)
public ReferenceHashMap(int keyType,
int valueType,
int capacity,
float loadFactor)
| Method Detail |
|---|
public int getMaxSize()
SizedMap
getMaxSize in interface SizedMappublic void setMaxSize(int maxSize)
SizedMap
setMaxSize in interface SizedMappublic boolean isFull()
SizedMap
isFull in interface SizedMap
public void overflowRemoved(Object key,
Object value)
SizedMap
overflowRemoved in interface SizedMappublic void valueExpired(Object key)
ReferenceMap
valueExpired in interface ReferenceMapkey - the key for the expired valuepublic void keyExpired(Object value)
ReferenceMap
keyExpired in interface ReferenceMapvalue - the value for the expired keypublic void removeExpired()
ReferenceMap
removeExpired in interface ReferenceMap
protected void addMapping(int hashIndex,
int hashCode,
Object key,
Object value)
protected HashEntry createEntry(HashEntry next,
int hashCode,
Object key,
Object value)
protected void purge(Reference ref)
protected void doWriteObject(ObjectOutputStream out)
throws IOException
IOException
protected void doReadObject(ObjectInputStream in)
throws ClassNotFoundException,
IOException
ClassNotFoundException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||