org.hsqldb.store
Class BaseHashMap

java.lang.Object
  extended byorg.hsqldb.store.BaseHashMap
Direct Known Subclasses:
HashMap, HashSet, IntKeyHashMap, IntKeyIntValueHashMap, IntValueHashMap, ValuePoolHashMap

public class BaseHashMap
extends Object


Nested Class Summary
protected  class BaseHashMap.BaseHashIterator
           
 
Field Summary
protected  org.hsqldb.store.HashIndex hashIndex
           
protected static int intKeyOrValue
           
protected  int[] intKeyTable
           
protected  int[] intValueTable
           
protected static int longKeyOrValue
           
protected  long[] longKeyTable
           
protected  long[] longValueTable
           
protected static int NO_PURGE
           
protected static int noKeyOrValue
           
protected static int objectKeyOrValue
           
protected  Object[] objectKeyTable
           
protected  Object[] objectValueTable
           
protected static int PURGE_ALL
           
protected static int PURGE_HALF
           
protected static int PURGE_QUARTER
           
protected  int purgePolicy
           
 
Constructor Summary
protected BaseHashMap(int initialCapacity, float loadFactor, int keyType, int valueType)
           
 
Method Summary
protected  Object addOrRemove(long longKey, long longValue, Object objectKey, Object objectValue, boolean remove)
           
 void clear()
          Clear the map completely.
protected  void clear(int count)
          Clear approximately count elements from the map, starting with those with low accessTable ranking.
protected  boolean containsKey(int key)
           
protected  boolean containsKey(long key)
           
protected  boolean containsKey(Object key)
           
protected  boolean containsValue(Object value)
           
protected  int getLookup(int key)
           
protected  int getLookup(long key)
           
protected  int getLookup(Object key, int hash)
           
protected  Object getObject(int key)
           
protected  Object getObject(long key)
           
protected  Object getObject(Object key)
           
 boolean isEmpty()
           
protected  void rehash(int newCapacity)
          rehash uses existing key and element arrays. key / value pairs are put back into the arrays from the top, removing any gaps. any redundant key / value pairs duplicated at the end of the array are then cleared.
protected  Object removeLookup(int lookup)
           
protected  Object removeObject(Object objectKey)
           
protected  void removeRow(int lookup)
          row must already been freed of key / element
protected  boolean reset()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hashIndex

protected org.hsqldb.store.HashIndex hashIndex

intKeyTable

protected int[] intKeyTable

objectKeyTable

protected Object[] objectKeyTable

longKeyTable

protected long[] longKeyTable

intValueTable

protected int[] intValueTable

objectValueTable

protected Object[] objectValueTable

longValueTable

protected long[] longValueTable

purgePolicy

protected int purgePolicy

noKeyOrValue

protected static final int noKeyOrValue
See Also:
Constant Field Values

intKeyOrValue

protected static final int intKeyOrValue
See Also:
Constant Field Values

longKeyOrValue

protected static final int longKeyOrValue
See Also:
Constant Field Values

objectKeyOrValue

protected static final int objectKeyOrValue
See Also:
Constant Field Values

NO_PURGE

protected static final int NO_PURGE
See Also:
Constant Field Values

PURGE_ALL

protected static final int PURGE_ALL
See Also:
Constant Field Values

PURGE_HALF

protected static final int PURGE_HALF
See Also:
Constant Field Values

PURGE_QUARTER

protected static final int PURGE_QUARTER
See Also:
Constant Field Values
Constructor Detail

BaseHashMap

protected BaseHashMap(int initialCapacity,
                      float loadFactor,
                      int keyType,
                      int valueType)
               throws IllegalArgumentException
Method Detail

getObject

protected Object getObject(int key)

getObject

protected Object getObject(long key)

getObject

protected Object getObject(Object key)

getLookup

protected int getLookup(Object key,
                        int hash)

getLookup

protected int getLookup(int key)

getLookup

protected int getLookup(long key)

addOrRemove

protected Object addOrRemove(long longKey,
                             long longValue,
                             Object objectKey,
                             Object objectValue,
                             boolean remove)

removeObject

protected Object removeObject(Object objectKey)

reset

protected boolean reset()

rehash

protected void rehash(int newCapacity)
rehash uses existing key and element arrays. key / value pairs are put back into the arrays from the top, removing any gaps. any redundant key / value pairs duplicated at the end of the array are then cleared. newCapacity must be larger or equal to existing number of elements.


removeRow

protected void removeRow(int lookup)
row must already been freed of key / element


removeLookup

protected Object removeLookup(int lookup)

clear

public void clear()
Clear the map completely.


clear

protected void clear(int count)
Clear approximately count elements from the map, starting with those with low accessTable ranking.


size

public int size()

isEmpty

public boolean isEmpty()

containsKey

protected boolean containsKey(Object key)

containsKey

protected boolean containsKey(int key)

containsKey

protected boolean containsKey(long key)

containsValue

protected boolean containsValue(Object value)


Copyright © 2001 - 2004 HSQL Development Group. All Rights Reserved.