| |
|
| java.lang.Object org.drools.reteoo.TupleSinkNodeList
TupleSinkNodeList | public class TupleSinkNodeList implements Serializable(Code) | | This is a simple linked linked implementation. Each node must implement LinkedListNode so that it references
the node before and after it. This way a node can be removed without having to scan the list to find it. This class
does not provide an Iterator implementation as its designed for efficiency and not genericity. There are a number of
ways to iterate the list.
Simple iterator:
for ( LinkedListNode node = list.getFirst(); node != null; node = node.getNext() ) {
}
Iterator that pops the first entry:
for ( LinkedListNode node = list.removeFirst(); node != null; node = list.removeFirst() ) {
}
author: Mark Proctor author: Bob McWhirter |
TupleSinkNodeList | public TupleSinkNodeList()(Code) | | Construct an empty LinkedList
|
add | public void add(TupleSinkNode node)(Code) | | Add a TupleSinkNode to the list. If the LinkedList is empty then the first and
last nodes are set to the added node.
Parameters: node - The TupleSinkNode to be added |
clear | public void clear()(Code) | | Iterates the list removing all the nodes until there are no more nodes to remove.
|
getFirst | final public TupleSinkNode getFirst()(Code) | | Return the first node in the list
The first TupleSinkNode . |
getLast | final public TupleSinkNode getLast()(Code) | | Return the last node in the list
The last TupleSinkNode . |
isEmpty | final public boolean isEmpty()(Code) | | boolean value indicating the empty status of the list |
remove | public void remove(TupleSinkNode node)(Code) | | Removes a TupleSinkNode 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 TupleSinkNode to be removed. |
removeFirst | public TupleSinkNode removeFirst()(Code) | | 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.
The first TupleSinkNode . |
removeLast | public TupleSinkNode removeLast()(Code) | | 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.
The first TupleSinkNode . |
size | final public int size()(Code) | | return size of the list as an int |
|
|
|