org.drools.core.util
Class ConcurrentRightTupleList

java.lang.Object
  extended by org.drools.core.util.ConcurrentRightTupleList
All Implemented Interfaces:
Entry, RightTupleMemory

public class ConcurrentRightTupleList
extends Object
implements RightTupleMemory, Entry


Field Summary
 AtomicReference<RightTuple> first
           
 AtomicReference<RightTuple> last
           
 AtomicReference<Entry> next
           
 AtomicReference<Entry> previous
           
 
Constructor Summary
ConcurrentRightTupleList()
           
ConcurrentRightTupleList(AbstractHashTable.Index index, int hashCode)
           
 
Method Summary
 void add(RightTuple rightTuple)
           
 boolean contains(InternalFactHandle handle)
           
 boolean contains(RightTuple rightTuple)
           
 boolean equals(Object object)
           
 FastIterator fastIterator()
           
 FastIterator fullFastIterator()
           
 FastIterator fullFastIterator(RightTuple rightTuple)
           
 RightTuple get(InternalFactHandle handle)
           
 RightTuple get(RightTuple rightTuple)
           
 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)
           
 RightTuple getLast(LeftTuple leftTuple)
           
 Entry getNext()
           
 int hashCode()
           
 boolean isIndexed()
           
 Iterator iterator()
           
 boolean matches(LeftTuple tuple, int tupleHashCode)
           
 boolean matches(Object object, int objectHashCode)
           
 void remove(RightTuple rightTuple)
          We assume that this rightTuple is contained in this hash table
 void removeAdd(RightTuple rightTuple)
           
 void setNext(Entry next)
           
 int size()
           
 Entry[] toArray()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

previous

public AtomicReference<Entry> previous

next

public AtomicReference<Entry> next

first

public AtomicReference<RightTuple> first

last

public AtomicReference<RightTuple> last
Constructor Detail

ConcurrentRightTupleList

public ConcurrentRightTupleList()

ConcurrentRightTupleList

public ConcurrentRightTupleList(AbstractHashTable.Index index,
                                int hashCode)
Method Detail

fullFastIterator

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

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)

removeAdd

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

add

public void add(RightTuple rightTuple)
Specified by:
add 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

get

public RightTuple get(InternalFactHandle handle)

contains

public boolean contains(InternalFactHandle handle)

get

public RightTuple get(RightTuple rightTuple)

contains

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

size

public int size()
Specified by:
size in interface RightTupleMemory

iterator

public Iterator iterator()
Specified by:
iterator in interface RightTupleMemory

fastIterator

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

fullFastIterator

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

matches

public boolean matches(Object object,
                       int objectHashCode)

matches

public boolean matches(LeftTuple tuple,
                       int tupleHashCode)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object

getNext

public Entry getNext()
Specified by:
getNext in interface Entry

setNext

public void setNext(Entry next)
Specified by:
setNext in interface Entry

isIndexed

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

toString

public String toString()
Overrides:
toString in class Object

toArray

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


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