ice.util.alg
Class HashArray

java.lang.Object
  extended byice.util.alg.HashArray

public class HashArray
extends Object

Hashtable implemenation that allow synchronization-free read access. It also can be used as a spare array with direct support for indexed entries


Nested Class Summary
static class HashArray.Entry
           
static class HashArray.Iterator
           
 
Constructor Summary
HashArray()
           
HashArray(int initialCapacity)
           
HashArray(Object lock)
           
HashArray(Object lock, int initialCapacity)
           
 
Method Summary
 void clear()
           
 Object clone()
           
 HashArray.Entry ensureEntry(int index)
           
 HashArray.Entry ensureEntry(Object key)
           
 Object get(int index)
           
 Object get(Object key)
           
 HashArray.Entry[] getEntries()
           
 HashArray.Entry getEntry(int index)
           
 HashArray.Entry getEntry(Object key)
           
 void getObjectKeys(Object[] result, int offset)
          Fill result array by all object kyes starting from offset.
 Object[] getValues()
           
 void getValues(Object[] result, int offset)
          Fill result array by all object kyes starting from offset.
 boolean has(int index)
           
 boolean has(Object key)
           
 boolean isEmpty()
           
 boolean isSealed()
           
 HashArray.Iterator newIterator()
           
 Object put(int index, Object value)
           
 Object put(Object key, Object value)
           
 Object remove(int index)
           
 Object remove(Object key)
           
 void sealObject()
           
 void setComparator(Comparator comparator)
           
 void setEntryPrototype(HashArray.Entry entryPrototype)
           
 Object setSynchronizationLock(Object new_lock)
           
 void setValue(int index, Object value)
           
 void setValue(Object key, Object value)
           
 int size()
           
 Object synchronizationLock()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashArray

public HashArray()

HashArray

public HashArray(Object lock)

HashArray

public HashArray(int initialCapacity)

HashArray

public HashArray(Object lock,
                 int initialCapacity)
Method Detail

clone

public Object clone()

setEntryPrototype

public void setEntryPrototype(HashArray.Entry entryPrototype)

setComparator

public void setComparator(Comparator comparator)

synchronizationLock

public final Object synchronizationLock()

setSynchronizationLock

public Object setSynchronizationLock(Object new_lock)

isEmpty

public boolean isEmpty()

size

public int size()

isSealed

public final boolean isSealed()

sealObject

public void sealObject()

getEntry

public HashArray.Entry getEntry(Object key)

getEntry

public HashArray.Entry getEntry(int index)

has

public final boolean has(Object key)

has

public final boolean has(int index)

get

public final Object get(Object key)

get

public final Object get(int index)

ensureEntry

public HashArray.Entry ensureEntry(Object key)

ensureEntry

public HashArray.Entry ensureEntry(int index)

put

public final Object put(Object key,
                        Object value)

put

public final Object put(int index,
                        Object value)

setValue

public final void setValue(Object key,
                           Object value)

setValue

public final void setValue(int index,
                           Object value)

remove

public Object remove(Object key)

remove

public Object remove(int index)

clear

public void clear()

newIterator

public HashArray.Iterator newIterator()

getEntries

public HashArray.Entry[] getEntries()

getObjectKeys

public void getObjectKeys(Object[] result,
                          int offset)
Fill result array by all object kyes starting from offset. result should be big enough to hold all object keys


getValues

public Object[] getValues()

getValues

public void getValues(Object[] result,
                      int offset)
Fill result array by all object kyes starting from offset. result should be big enough to hold all object keys