Class TupleList

java.lang.Object
org.drools.core.util.LinkedList<TupleImpl>
org.drools.core.util.index.TupleList
All Implemented Interfaces:
Externalizable, Serializable, TupleMemory, SingleLinkedEntry<TupleList>
Direct Known Subclasses:
AbstractHashTable.IndexTupleList, AbstractTupleIndexTree.IndexTupleList, TupleListWithContext, TupleRBTree.Node

public class TupleList extends LinkedList<TupleImpl> implements TupleMemory, SingleLinkedEntry<TupleList>, Serializable
See Also:
  • Field Details

  • Constructor Details

    • TupleList

      public TupleList()
    • TupleList

      public TupleList(TupleImpl first, TupleImpl last, int size)
  • Method Details

    • add

      public void add(TupleImpl node)
      Description copied from class: LinkedList
      Add a LinkedListNode to the list. If the LinkedList is empty then the first and last nodes are set to the added node.
      Specified by:
      add in interface TupleMemory
      Overrides:
      add in class LinkedList<TupleImpl>
      Parameters:
      node - The LinkedListNode to be added
    • remove

      public void remove(TupleImpl node)
      Description copied from class: LinkedList
      Removes a LinkedListNode from the list. This works by attach the previous reference to the child reference. When the node to be removed is the first node it calls removeFirst(). When the node to be removed is the last node it calls removeLast().
      Specified by:
      remove in interface TupleMemory
      Overrides:
      remove in class LinkedList<TupleImpl>
      Parameters:
      node - The LinkedListNode to be removed.
    • getFirst

      public TupleImpl getFirst(TupleImpl tuple)
      Description copied from interface: TupleMemory
      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 TupleMemory
    • get

      public TupleImpl get(InternalFactHandle handle)
    • removeFirst

      public TupleImpl removeFirst()
      Description copied from class: LinkedList
      Remove the first node from the list. The next node then becomes the first node. If this is the last node then both first and last node references are set to null.
      Overrides:
      removeFirst in class LinkedList<TupleImpl>
      Returns:
      The first LinkedListNode.
    • removeLast

      public TupleImpl removeLast()
      Description copied from class: LinkedList
      Remove the last node from the list. The previous node then becomes the last node. If this is the last node then both first and last node references are set to null.
      Overrides:
      removeLast in class LinkedList<TupleImpl>
      Returns:
      The first LinkedListNode.
    • getIndexType

      public TupleMemory.IndexType getIndexType()
      Specified by:
      getIndexType in interface TupleMemory
    • fastIterator

      public FastIterator<TupleImpl> fastIterator()
      Specified by:
      fastIterator in interface TupleMemory
      Overrides:
      fastIterator in class LinkedList<TupleImpl>
    • fullFastIterator

      public FastIterator<TupleImpl> fullFastIterator()
      Description copied from interface: TupleMemory
      Iterates the entire data structure, regardless of whether TupleMemory is hashed or not.
      Specified by:
      fullFastIterator in interface TupleMemory
      Returns:
    • fullFastIterator

      public FastIterator<TupleImpl> fullFastIterator(TupleImpl tuple)
      Description copied from interface: TupleMemory
      Iterator that resumes from the current RightTuple, regardless of whether the TupleMemory is hashed or not
      Specified by:
      fullFastIterator in interface TupleMemory
      Returns:
    • isIndexed

      public boolean isIndexed()
      Specified by:
      isIndexed in interface TupleMemory
    • getNext

      public TupleList getNext()
      Specified by:
      getNext in interface SingleLinkedEntry<TupleList>
    • setNext

      public void setNext(TupleList next)
      Specified by:
      setNext in interface SingleLinkedEntry<TupleList>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • copyStateInto

      protected void copyStateInto(TupleList other)