Package org.drools.core.util.index
Class TupleIndexRBTree
- java.lang.Object
-
- org.drools.core.util.index.TupleIndexRBTree
-
- All Implemented Interfaces:
Externalizable,Serializable,TupleMemory
public class TupleIndexRBTree extends Object implements Externalizable, TupleMemory
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classTupleIndexRBTree.TupleFastIterator-
Nested classes/interfaces inherited from interface org.drools.core.reteoo.TupleMemory
TupleMemory.IndexType
-
-
Constructor Summary
Constructors Constructor Description TupleIndexRBTree()TupleIndexRBTree(IndexUtil.ConstraintType constraintType, AbstractHashTable.FieldIndex index, boolean left)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Tuple tuple)voidclear()booleancontains(Tuple leftTuple)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.TupleMemory.IndexTypegetIndexType()booleanisIndexed()Iterator<Tuple>iterator()voidreadExternal(ObjectInput in)voidremove(Tuple tuple)voidremoveAdd(Tuple tuple)intsize()Entry[]toArray()voidwriteExternal(ObjectOutput out)
-
-
-
Constructor Detail
-
TupleIndexRBTree
public TupleIndexRBTree()
-
TupleIndexRBTree
public TupleIndexRBTree(IndexUtil.ConstraintType constraintType, AbstractHashTable.FieldIndex index, boolean left)
-
-
Method Detail
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
add
public void add(Tuple tuple)
- Specified by:
addin interfaceTupleMemory
-
remove
public void remove(Tuple tuple)
- Specified by:
removein interfaceTupleMemory
-
removeAdd
public void removeAdd(Tuple tuple)
- Specified by:
removeAddin interfaceTupleMemory
-
isIndexed
public boolean isIndexed()
- Specified by:
isIndexedin interfaceTupleMemory
-
size
public int size()
- Specified by:
sizein interfaceTupleMemory
-
toArray
public Entry[] toArray()
- Specified by:
toArrayin interfaceTupleMemory
-
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
-
iterator
public Iterator<Tuple> iterator()
- Specified by:
iteratorin interfaceTupleMemory
-
contains
public boolean contains(Tuple leftTuple)
- Specified by:
containsin interfaceTupleMemory
-
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:
-
clear
public void clear()
- Specified by:
clearin interfaceTupleMemory
-
getIndexType
public TupleMemory.IndexType getIndexType()
- Specified by:
getIndexTypein interfaceTupleMemory
-
-