Top Description Fields Constructors Methods
org.hsqldb.map

public Class ValuePoolHashMap

extends BaseHashMap
Class Inheritance
Imports
org.hsqldb.types.TimestampData

Subclass of BaseHashMap for maintaining a pool of objects. Supports a range of java.lang.* objects.
Author
Fred Toussi (fredt@users dot sourceforge.net)
Since
1.7.2
Version
2.5.1

Field Summary

Modifier and TypeField and Description
pack-priv long
Inherited from org.hsqldb.map.BaseHashMap:
ACCESS_MAXaccessCountaccessMinaccessTablecomparatoremptyObjectArrayhashIndexhasZeroKeyinitialCapacityintKeyOrValueintKeyTableintValueTableisAccessCountisIntKeyisIntValueisLastAccessCountisListisLongKeyisLongValueisMultiValueisNoValueisObjectKeyisObjectValueloadFactorlongKeyOrValuelongKeyTablelongValueTablemaxCapacityminimizeOnEmptyNO_PURGEnoKeyOrValueobjectKeyOrValueobjectKeyTableobjectValueTableobjectValueTable2objectValueTable3PURGE_ALLPURGE_HALFpurgePolicythresholdzeroKeyIndexzeroOrNullValueCount

Constructor Summary

AccessConstructor and Description
public
ValuePoolHashMap(int initialCapacity, int maxCapacity, int purgePolicy)

Method Summary

Modifier and TypeMethod and Description
protected TimestampData
getOrAddDate(long longKey)

protected Double
getOrAddDouble(long longKey)

protected Integer
getOrAddInteger(int intKey)

protected Long
getOrAddLong(long longKey)

protected Object
protected String

Returns:

String from map or a new String
getOrAddString
(Object
String or other Object with compatible equals(String) and hashCode().
key
)

This is dissimilar to normal hash map get() methods.

protected String
getOrAddSubString(String key, int from, int limit)

Inherited from org.hsqldb.map.BaseHashMap:
addMultiValaddOrRemoveObjectaddOrUpdatecapacityclearclonecontainsIntKeycontainsLongKeycontainsObjectKeycontainsValuecontainsValuecontainsValueduplicategetAccessCountCeilinggetLookupgetLookupgetLookupgetLookupgetMultiValuesIteratorgetObjectLookupinsertIntoElementArraysinsertRowisEmptymultiValueElementCountmultiValueKeyCountmultiValueKeysToArraynextLookupnextLookuprehashremoveremoveFromElementArraysremoveMultiValremoveObjectremoveRowresetresetAccessCountsetAccessCountFloorsizetoArraytoArraytoIntArraytoLongArray

Field Detail

hitsback to summary
pack-priv long hits

Constructor Detail

ValuePoolHashMapback to summary
public ValuePoolHashMap(int initialCapacity, int maxCapacity, int purgePolicy) throws IllegalArgumentException

Method Detail

getOrAddDateback to summary
protected TimestampData getOrAddDate(long longKey)
getOrAddDoubleback to summary
protected Double getOrAddDouble(long longKey)
getOrAddIntegerback to summary
protected Integer getOrAddInteger(int intKey)
getOrAddLongback to summary
protected Long getOrAddLong(long longKey)
getOrAddObjectback to summary
protected Object getOrAddObject(Object key)
getOrAddStringback to summary
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 result of the toString() method of the wrapper, or return an existing String which would be equal to the result of toString().

Parameters
key:Object

String or other Object with compatible equals(String) and hashCode().

Returns:String

String from map or a new String

getOrAddSubStringback to summary
protected String getOrAddSubString(String key, int from, int limit)