ahc.collection.store
Class HashStore

java.lang.Object
  |
  +--ahc.collection.store.AbstractStore
        |
        +--ahc.collection.store.HashStore
All Implemented Interfaces:
Store

public class HashStore
extends ahc.collection.store.AbstractStore

Author:
Arno Haase

Field Summary
protected  EqualityStrategy _eqStrat
           
 
Constructor Summary
HashStore(EqualityStrategy eqStrat)
           
HashStore(EqualityStrategy eqStrat, int initialSize)
           
HashStore(EqualityStrategy eqStrat, int initialSize, double loadFactor)
           
 
Method Summary
 Iterator after()
           
 void append(java.lang.Object o)
           
 Iterator before()
           
 Iterator begin()
           
 void clear()
           
 void compactSize()
           
 boolean contains(java.lang.Object o)
           
 Iterator end()
           
 Iterator first(java.lang.Object o)
           
 java.lang.Object get(int index)
           
 EqualityStrategy getEqualityStrategy()
           
 boolean isEmpty()
           
 boolean isSorted()
          true means that the store's internal representation is sorted (i.e.
 Iterator iter(int ind)
           
 Iterator last(java.lang.Object o)
           
 void prepend(java.lang.Object o)
           
 boolean preservesOrdering()
          true means that the store retains elements in an order that can be specified from the outside (e.g. array), false otherwise.
 void rehash()
           
 void rehash(int numBuckets)
           
 java.lang.Object remove(int index)
           
 boolean remove(java.lang.Object o)
           
 java.lang.Object set(int index, java.lang.Object element)
           
 void setEqualityStrategy(EqualityStrategy eqStrat)
           
 int size()
           
 java.lang.Object[] toArray()
           
 java.lang.Object[] toArray(java.lang.Object[] dest)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_eqStrat

protected EqualityStrategy _eqStrat
Constructor Detail

HashStore

public HashStore(EqualityStrategy eqStrat)

HashStore

public HashStore(EqualityStrategy eqStrat,
                 int initialSize)

HashStore

public HashStore(EqualityStrategy eqStrat,
                 int initialSize,
                 double loadFactor)
Method Detail

preservesOrdering

public boolean preservesOrdering()
Description copied from interface: Store
true means that the store retains elements in an order that can be specified from the outside (e.g. array), false otherwise.


isSorted

public boolean isSorted()
Description copied from interface: Store
true means that the store's internal representation is sorted (i.e. relative to a Comparator), false otherwise. This is similar to the issue of order preservation but not the same: e.g. a hash-based store does not preserve ordering but is not sorted.


prepend

public void prepend(java.lang.Object o)

append

public void append(java.lang.Object o)

size

public int size()

clear

public void clear()

before

public Iterator before()

begin

public Iterator begin()

end

public Iterator end()

after

public Iterator after()

iter

public Iterator iter(int ind)

first

public Iterator first(java.lang.Object o)
Specified by:
first in interface Store
Overrides:
first in class ahc.collection.store.AbstractStore

compactSize

public void compactSize()

rehash

public void rehash()

rehash

public void rehash(int numBuckets)

getEqualityStrategy

public EqualityStrategy getEqualityStrategy()
Specified by:
getEqualityStrategy in interface Store

setEqualityStrategy

public void setEqualityStrategy(EqualityStrategy eqStrat)
Specified by:
setEqualityStrategy in interface Store

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface Store

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Store

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface Store

last

public Iterator last(java.lang.Object o)
Specified by:
last in interface Store

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface Store

toArray

public java.lang.Object[] toArray(java.lang.Object[] dest)
Specified by:
toArray in interface Store

get

public java.lang.Object get(int index)
Specified by:
get in interface Store

set

public java.lang.Object set(int index,
                            java.lang.Object element)
Specified by:
set in interface Store

remove

public java.lang.Object remove(int index)
Specified by:
remove in interface Store