Package org.drools.core.util.index
Class TupleIndexHashTable
- java.lang.Object
-
- org.drools.core.util.AbstractHashTable
-
- org.drools.core.util.index.TupleIndexHashTable
-
- All Implemented Interfaces:
Externalizable,Serializable,TupleMemory
public class TupleIndexHashTable extends AbstractHashTable implements TupleMemory
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTupleIndexHashTable.FieldIndexHashTableFullIteratorstatic classTupleIndexHashTable.FullFastIterator-
Nested classes/interfaces inherited from class org.drools.core.util.AbstractHashTable
AbstractHashTable.AbstractObjectComparator, AbstractHashTable.DoubleCompositeIndex, AbstractHashTable.DoubleHashEntry, AbstractHashTable.EqualityEquals, AbstractHashTable.FieldIndex, AbstractHashTable.HashEntry, AbstractHashTable.Index, AbstractHashTable.IndexTupleList, AbstractHashTable.InstanceEquals, AbstractHashTable.ObjectComparator, AbstractHashTable.SingleHashEntry, AbstractHashTable.SingleIndex, AbstractHashTable.TripleCompositeIndex, AbstractHashTable.TripleHashEntry
-
Nested classes/interfaces inherited from interface org.drools.core.reteoo.TupleMemory
TupleMemory.IndexType
-
-
Field Summary
Fields Modifier and Type Field Description static intPRIME-
Fields inherited from class org.drools.core.util.AbstractHashTable
comparator, loadFactor, size, table, threshold
-
-
Constructor Summary
Constructors Constructor Description TupleIndexHashTable()TupleIndexHashTable(int capacity, float loadFactor, AbstractHashTable.FieldIndex[] index, boolean left)TupleIndexHashTable(AbstractHashTable.FieldIndex[] index, boolean left)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Tuple tuple)voidclear()booleancontains(Tuple tuple)FastIteratorfastIterator()FastIteratorfullFastIterator()Iterates the entire data structure, regardless of whether TupleMemory is hashed or not.FastIteratorfullFastIterator(Tuple leftTuple)Iterator that resumes from the current RightTuple, regardless of whether the TupleMemory is hashed or notTuplegetFirst(Tuple rightTuple)The FactHandle is always the context fact and is necessary when the object being modified is in the both left and right node memories.AbstractHashTable.IndexgetIndex()TupleMemory.IndexTypegetIndexType()intgetResizeHashcode(Entry entry)voidinit(Entry[] table, int size, int factSize)booleanisIndexed()Iterator<Tuple>iterator()voidreadExternal(ObjectInput in)voidremove(Tuple tuple)voidremoveAdd(Tuple tuple)intsize()Tuple[]toArray()StringtoString()voidwriteExternal(ObjectOutput out)-
Methods inherited from class org.drools.core.util.AbstractHashTable
ensureCapacity, getTable, indexOf, isEmpty, newIterator, rehash, resize, setComparator
-
-
-
-
Field Detail
-
PRIME
public static final int PRIME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TupleIndexHashTable
public TupleIndexHashTable()
-
TupleIndexHashTable
public TupleIndexHashTable(AbstractHashTable.FieldIndex[] index, boolean left)
-
TupleIndexHashTable
public TupleIndexHashTable(int capacity, float loadFactor, AbstractHashTable.FieldIndex[] index, boolean left)
-
-
Method Detail
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classAbstractHashTable- Throws:
IOExceptionClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classAbstractHashTable- Throws:
IOException
-
init
public void init(Entry[] table, int size, int factSize)
-
iterator
public Iterator<Tuple> iterator()
- Specified by:
iteratorin interfaceTupleMemory- Overrides:
iteratorin classAbstractHashTable
-
fastIterator
public FastIterator fastIterator()
- Specified by:
fastIteratorin interfaceTupleMemory
-
fullFastIterator
public FastIterator fullFastIterator()
Description copied from interface:TupleMemoryIterates the entire data structure, regardless of whether TupleMemory is hashed or not.- Specified by:
fullFastIteratorin interfaceTupleMemory- Returns:
-
fullFastIterator
public FastIterator fullFastIterator(Tuple leftTuple)
Description copied from interface:TupleMemoryIterator that resumes from the current RightTuple, regardless of whether the TupleMemory is hashed or not- Specified by:
fullFastIteratorin interfaceTupleMemory- Returns:
-
getFirst
public Tuple getFirst(Tuple rightTuple)
Description copied from interface:TupleMemoryThe FactHandle is always the context fact and is necessary when the object being modified is in the both left and right node memories. This is because the memory on the opposite side would not have yet memory.removeAdd the fact, so it could potentially be in the wrong bucket. So the bucket matches check always checks to ignore the first facthandle if it's the same as the context fact.- Specified by:
getFirstin interfaceTupleMemory
-
isIndexed
public boolean isIndexed()
- Specified by:
isIndexedin interfaceTupleMemory
-
getIndex
public AbstractHashTable.Index getIndex()
-
getResizeHashcode
public int getResizeHashcode(Entry entry)
- Specified by:
getResizeHashcodein classAbstractHashTable
-
toArray
public Tuple[] toArray()
- Specified by:
toArrayin interfaceTupleMemory- Overrides:
toArrayin classAbstractHashTable
-
removeAdd
public void removeAdd(Tuple tuple)
- Specified by:
removeAddin interfaceTupleMemory
-
add
public void add(Tuple tuple)
- Specified by:
addin interfaceTupleMemory
-
remove
public void remove(Tuple tuple)
- Specified by:
removein interfaceTupleMemory
-
contains
public boolean contains(Tuple tuple)
- Specified by:
containsin interfaceTupleMemory
-
size
public int size()
- Specified by:
sizein interfaceTupleMemory- Overrides:
sizein classAbstractHashTable
-
toString
public String toString()
- Overrides:
toStringin classAbstractHashTable
-
clear
public void clear()
- Specified by:
clearin interfaceTupleMemory- Overrides:
clearin classAbstractHashTable
-
getIndexType
public TupleMemory.IndexType getIndexType()
- Specified by:
getIndexTypein interfaceTupleMemory
-
-