org.hsqldb.store
Class ValuePoolHashMap
java.lang.Object
org.hsqldb.store.BaseHashMap
org.hsqldb.store.ValuePoolHashMap
- public class ValuePoolHashMap
- extends BaseHashMap
To Do:
- fredt - check accessCount and reset on each getOrAddXXX()
Fields inherited from class org.hsqldb.store.BaseHashMap |
hashIndex, intKeyOrValue, intKeyTable, intValueTable, longKeyOrValue, longKeyTable, longValueTable, NO_PURGE, noKeyOrValue, objectKeyOrValue, objectKeyTable, objectValueTable, PURGE_ALL, PURGE_HALF, PURGE_QUARTER, purgePolicy |
Constructor Summary |
ValuePoolHashMap(int initialCapacity,
int maxCapacity,
int purgePolicy)
|
Methods inherited from class org.hsqldb.store.BaseHashMap |
addOrRemove, clear, clear, containsKey, containsKey, containsKey, containsValue, getLookup, getLookup, getLookup, getObject, getObject, getObject, isEmpty, rehash, removeLookup, removeObject, removeRow, reset, size |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ValuePoolHashMap
public ValuePoolHashMap(int initialCapacity,
int maxCapacity,
int purgePolicy)
throws IllegalArgumentException
resetCapacity
public void resetCapacity(int maxCapacity,
int purgePolicy)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
getOrAddInteger
protected Integer getOrAddInteger(int intKey)
getOrAddLong
protected Long getOrAddLong(long longKey)
getOrAddString
protected String getOrAddString(Object key)
- This is dissimilar to normal hash map get() methods. The key Object
should have an equals(String) method which should return true if the
key.toString.equals(String) is true. Also the key.hashCode() method
must return the same value as key.toString.hashCode().
The above is always true when the key is a String. But it means it is
possible to submit special keys that fulfill the contract. For example
a wrapper around a byte[] can be submitted as key to retrieve either
a new String, which is the toString() method of the wrapper, or return
an existing String which would be equal to the product of toString().
- Parameters:
key
- String or other Object with compatible equals(String)
and hashCode().
- Returns:
- String from map or a new String
getOrAddDate
protected Date getOrAddDate(long longKey)
getOrAddDouble
protected Double getOrAddDouble(long longKey)
getOrAddObject
protected Object getOrAddObject(Object key)
Copyright © 2001 - 2004 HSQL Development Group. All Rights Reserved.