org.drools.util
Class MultiLinkedList

java.lang.Object
  extended byorg.drools.util.LinkedList
      extended byorg.drools.util.MultiLinkedList
All Implemented Interfaces:
java.io.Serializable

public class MultiLinkedList
extends LinkedList

MultiLinkedList A linked list where each node has a reference to the list itself and to a child node.

See Also:
Serialized Form
 

Constructor Summary
MultiLinkedList()
           
 
Method Summary
 void add(MultiLinkedListNode node)
          Add a MultiLinkedListNode to the list.
 void remove(MultiLinkedListNode node)
          Removes a MultiLinkedListNode from the list.
 
Methods inherited from class org.drools.util.LinkedList
add, clear, getFirst, getLast, isEmpty, iterator, remove, removeFirst, removeLast, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiLinkedList

public MultiLinkedList()
Method Detail

add

public void add(MultiLinkedListNode node)
Add a MultiLinkedListNode to the list. If the MultiLinkedList is empty then the first and last nodes are set to the added node.

Parameters:
node - The LinkedListNode to be added

remove

public void remove(MultiLinkedListNode node)
Removes a MultiLinkedListNode 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().

Parameters:
node - The LinkedListNode to be removed.