Package org.drools.core.util
Class AbstractHashTable
- java.lang.Object
-
- org.drools.core.util.AbstractHashTable
-
- All Implemented Interfaces:
Externalizable,Serializable
- Direct Known Subclasses:
ObjectHashMap,ObjectHashSet,TripleStore,TupleIndexHashTable
public abstract class AbstractHashTable extends Object implements Externalizable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractHashTable.AbstractObjectComparatorstatic classAbstractHashTable.DoubleCompositeIndexstatic classAbstractHashTable.DoubleHashEntrystatic classAbstractHashTable.EqualityEqualsstatic classAbstractHashTable.FieldIndexstatic interfaceAbstractHashTable.HashEntrystatic interfaceAbstractHashTable.Indexstatic classAbstractHashTable.IndexTupleListstatic classAbstractHashTable.InstanceEqualsstatic interfaceAbstractHashTable.ObjectComparatorstatic classAbstractHashTable.SingleHashEntrystatic classAbstractHashTable.SingleIndexstatic classAbstractHashTable.TripleCompositeIndexstatic classAbstractHashTable.TripleHashEntry
-
Field Summary
Fields Modifier and Type Field Description protected AbstractHashTable.ObjectComparatorcomparatorprotected floatloadFactorstatic intPRIMEprotected intsizeprotected Entry<TupleList>[]tableprotected intthreshold
-
Constructor Summary
Constructors Constructor Description AbstractHashTable()AbstractHashTable(float loadFactor, Entry[] table)AbstractHashTable(int capacity, float loadFactor)AbstractHashTable(Entry[] table)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclear()voidensureCapacity(int itemsToBeAdded)abstract intgetResizeHashcode(Entry entry)Entry<TupleList>[]getTable()protected static intindexOf(int hashCode, int dataSize)booleanisEmpty()Iteratoriterator()IteratornewIterator()voidreadExternal(ObjectInput in)static intrehash(int hash)protected voidresize(int newCapacity)voidsetComparator(AbstractHashTable.ObjectComparator comparator)intsize()Entry[]toArray()StringtoString()voidwriteExternal(ObjectOutput out)
-
-
-
Field Detail
-
PRIME
public static final int PRIME
- See Also:
- Constant Field Values
-
size
protected int size
-
threshold
protected int threshold
-
loadFactor
protected float loadFactor
-
comparator
protected AbstractHashTable.ObjectComparator comparator
-
-
Method Detail
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
iterator
public Iterator iterator()
-
newIterator
public Iterator newIterator()
-
setComparator
public void setComparator(AbstractHashTable.ObjectComparator comparator)
-
ensureCapacity
public void ensureCapacity(int itemsToBeAdded)
-
resize
protected void resize(int newCapacity)
-
getResizeHashcode
public abstract int getResizeHashcode(Entry entry)
-
toArray
public Entry[] toArray()
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
rehash
public static int rehash(int hash)
-
indexOf
protected static int indexOf(int hashCode, int dataSize)
-
clear
public void clear()
-
-