Package org.drools.core.util.index
Class TupleIndexRBTree
- java.lang.Object
-
- org.drools.core.util.index.AbstractTupleIndexTree
-
- org.drools.core.util.index.TupleIndexRBTree
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,TupleMemory
public class TupleIndexRBTree extends AbstractTupleIndexTree implements java.io.Externalizable, TupleMemory
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classTupleIndexRBTree.TupleFastIterator-
Nested classes/interfaces inherited from class org.drools.core.util.index.AbstractTupleIndexTree
AbstractTupleIndexTree.IndexTupleList
-
Nested classes/interfaces inherited from interface org.drools.core.reteoo.TupleMemory
TupleMemory.IndexType
-
-
Field Summary
-
Fields inherited from class org.drools.core.util.index.AbstractTupleIndexTree
constraintType, factSize, index, left
-
-
Constructor Summary
Constructors Constructor Description TupleIndexRBTree()TupleIndexRBTree(IndexUtil.ConstraintType constraintType, AbstractHashTable.FieldIndex index, boolean left)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Tuple tuple)voidclear()static java.lang.ComparablecoerceType(AbstractHashTable.FieldIndex index, java.lang.Comparable treeRootKey, java.lang.Comparable key)FastIterator<Tuple>fastIterator()FastIterator<Tuple>fullFastIterator()Iterates the entire data structure, regardless of whether TupleMemory is hashed or not.FastIterator<Tuple>fullFastIterator(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()Iterator<Tuple>iterator()voidreadExternal(java.io.ObjectInput in)voidremove(Tuple tuple)voidremoveAdd(Tuple tuple)intsize()Tuple[]toArray()voidwriteExternal(java.io.ObjectOutput out)-
Methods inherited from class org.drools.core.util.index.AbstractTupleIndexTree
getIndexedValue, getLeftIndexedValue, getRightIndexedValue, isIndexed
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.drools.core.reteoo.TupleMemory
getIndex, isIndexed
-
-
-
-
Constructor Detail
-
TupleIndexRBTree
public TupleIndexRBTree()
-
TupleIndexRBTree
public TupleIndexRBTree(IndexUtil.ConstraintType constraintType, AbstractHashTable.FieldIndex index, boolean left)
-
-
Method Detail
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
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
-
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
-
size
public int size()
- Specified by:
sizein interfaceTupleMemory
-
toArray
public Tuple[] 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
-
fastIterator
public FastIterator<Tuple> fastIterator()
- Specified by:
fastIteratorin interfaceTupleMemory
-
fullFastIterator
public FastIterator<Tuple> 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<Tuple> 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:
-
coerceType
public static java.lang.Comparable coerceType(AbstractHashTable.FieldIndex index, java.lang.Comparable treeRootKey, java.lang.Comparable key)
-
clear
public void clear()
- Specified by:
clearin interfaceTupleMemory
-
getIndexType
public TupleMemory.IndexType getIndexType()
- Specified by:
getIndexTypein interfaceTupleMemory
-
-