org.drools.core.util
Class RightTupleIndexHashTable

java.lang.Object
  extended by org.drools.core.util.AbstractHashTable
      extended by org.drools.core.util.RightTupleIndexHashTable
All Implemented Interfaces:
Externalizable, Serializable, RightTupleMemory

public class RightTupleIndexHashTable
extends AbstractHashTable
implements RightTupleMemory

See Also:
Serialized Form

Nested Class Summary
static class RightTupleIndexHashTable.FieldIndexHashTableFullIterator
           
static class RightTupleIndexHashTable.FullFastIterator
           
 
Nested classes/interfaces inherited from class org.drools.core.util.AbstractHashTable
AbstractHashTable.AbstractObjectComparator, AbstractHashTable.DoubleCompositeIndex, AbstractHashTable.EqualityEquals, AbstractHashTable.FieldIndex, AbstractHashTable.HashTableIterator, AbstractHashTable.Index, AbstractHashTable.InstanceEquals, AbstractHashTable.ObjectComparator, AbstractHashTable.SingleIndex, AbstractHashTable.TripleCompositeIndex
 
Field Summary
static int PRIME
           
 
Fields inherited from class org.drools.core.util.AbstractHashTable
comparator, loadFactor, size, table, threshold
 
Constructor Summary
RightTupleIndexHashTable()
           
RightTupleIndexHashTable(AbstractHashTable.FieldIndex[] index)
           
RightTupleIndexHashTable(int capacity, float loadFactor, AbstractHashTable.FieldIndex[] index)
           
 
Method Summary
 void add(RightTuple rightTuple)
           
 boolean contains(RightTuple rightTuple)
           
 FastIterator fastIterator()
           
 FastIterator fullFastIterator()
           
 FastIterator fullFastIterator(RightTuple rightTuple)
           
 RightTupleList get(LeftTuple tuple, InternalFactHandle factHandle)
           
 Entry getBucket(Object object)
           
 RightTuple getFirst(LeftTuple leftTuple, InternalFactHandle factHandle)
          The FactHandle is always the context fact and is necessary when the object being modified is in the both left and right node memories.
 RightTuple getFirst(RightTuple rightTuple)
           
 AbstractHashTable.Index getIndex()
           
 RightTuple getLast(LeftTuple leftTuple)
           
 int getResizeHashcode(Entry entry)
           
 void init(Entry[] table, int size, int factSize)
           
 boolean isIndexed()
           
 Iterator iterator()
           
 void readExternal(ObjectInput in)
           
 void remove(RightTuple rightTuple)
          We assume that this rightTuple is contained in this hash table
 void removeAdd(RightTuple rightTuple)
           
 int size()
           
 Entry[] toArray()
           
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class org.drools.core.util.AbstractHashTable
getBucket, getTable, indexOf, isEmpty, newIterator, rehash, resize, setComparator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PRIME

public static final int PRIME
See Also:
Constant Field Values
Constructor Detail

RightTupleIndexHashTable

public RightTupleIndexHashTable()

RightTupleIndexHashTable

public RightTupleIndexHashTable(AbstractHashTable.FieldIndex[] index)

RightTupleIndexHashTable

public RightTupleIndexHashTable(int capacity,
                                float loadFactor,
                                AbstractHashTable.FieldIndex[] index)
Method Detail

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class AbstractHashTable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class AbstractHashTable
Throws:
IOException

init

public void init(Entry[] table,
                 int size,
                 int factSize)

getFirst

public RightTuple getFirst(LeftTuple leftTuple,
                           InternalFactHandle factHandle)
Description copied from interface: RightTupleMemory
The 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:
getFirst in interface RightTupleMemory
Returns:

getFirst

public RightTuple getFirst(RightTuple rightTuple)

getLast

public RightTuple getLast(LeftTuple leftTuple)

isIndexed

public boolean isIndexed()
Specified by:
isIndexed in interface RightTupleMemory

getIndex

public AbstractHashTable.Index getIndex()

getBucket

public Entry getBucket(Object object)
Specified by:
getBucket in class AbstractHashTable

iterator

public Iterator iterator()
Specified by:
iterator in interface RightTupleMemory
Overrides:
iterator in class AbstractHashTable

getResizeHashcode

public int getResizeHashcode(Entry entry)
Specified by:
getResizeHashcode in class AbstractHashTable

fastIterator

public FastIterator fastIterator()
Specified by:
fastIterator in interface RightTupleMemory

fullFastIterator

public FastIterator fullFastIterator()
Specified by:
fullFastIterator in interface RightTupleMemory

fullFastIterator

public FastIterator fullFastIterator(RightTuple rightTuple)
Specified by:
fullFastIterator in interface RightTupleMemory

toArray

public Entry[] toArray()
Specified by:
toArray in interface RightTupleMemory
Overrides:
toArray in class AbstractHashTable

add

public void add(RightTuple rightTuple)
Specified by:
add in interface RightTupleMemory

removeAdd

public void removeAdd(RightTuple rightTuple)
Specified by:
removeAdd in interface RightTupleMemory

remove

public void remove(RightTuple rightTuple)
We assume that this rightTuple is contained in this hash table

Specified by:
remove in interface RightTupleMemory

contains

public boolean contains(RightTuple rightTuple)
Specified by:
contains in interface RightTupleMemory

get

public RightTupleList get(LeftTuple tuple,
                          InternalFactHandle factHandle)

size

public int size()
Specified by:
size in interface RightTupleMemory
Overrides:
size in class AbstractHashTable

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.