Package org.drools.core.util
Class AbstractHashTable
- java.lang.Object
-
- org.drools.core.util.AbstractHashTable
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable
- Direct Known Subclasses:
TupleIndexHashTable
public abstract class AbstractHashTable extends java.lang.Object implements java.io.Externalizable- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractHashTable.DoubleCompositeIndexstatic classAbstractHashTable.DoubleHashEntrystatic classAbstractHashTable.FieldIndexstatic interfaceAbstractHashTable.HashEntrystatic interfaceAbstractHashTable.Indexstatic classAbstractHashTable.IndexTupleListstatic classAbstractHashTable.SingleHashEntrystatic classAbstractHashTable.SingleIndexstatic classAbstractHashTable.TripleCompositeIndexstatic classAbstractHashTable.TripleHashEntry
-
Constructor Summary
Constructors Constructor Description AbstractHashTable()AbstractHashTable(float loadFactor, TupleList[] table)AbstractHashTable(int capacity, float loadFactor)AbstractHashTable(TupleList[] table)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclear()voidensureCapacity(int itemsToBeAdded)abstract intgetResizeHashcode(TupleList entry)TupleList<TupleList>[]getTable()protected static intindexOf(int hashCode, int dataSize)booleanisEmpty()Iteratoriterator()IteratornewIterator()voidreadExternal(java.io.ObjectInput in)static intrehash(int hash)protected voidresize(int newCapacity)intsize()java.lang.StringtoString()voidwriteExternal(java.io.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
-
table
protected TupleList[] table
-
-
Method Detail
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
iterator
public Iterator iterator()
-
newIterator
public Iterator newIterator()
-
ensureCapacity
public void ensureCapacity(int itemsToBeAdded)
-
resize
protected void resize(int newCapacity)
-
getResizeHashcode
public abstract int getResizeHashcode(TupleList entry)
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
rehash
public static int rehash(int hash)
-
indexOf
protected static int indexOf(int hashCode, int dataSize)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
clear
public void clear()
-
-