net.sourceforge.combean.graph.containers
Class ListAsNodeQueue

Package class diagram package ListAsNodeQueue
java.lang.Object
  extended by net.sourceforge.combean.graph.containers.ListAsNodeQueue
All Implemented Interfaces:
FixedNodeCollection, NodeQueue

public class ListAsNodeQueue
extends Object
implements NodeQueue

A node queue which is based on a java.util.List


Constructor Summary
ListAsNodeQueue()
          Constructor.
ListAsNodeQueue(List<Node> l)
          Constructor.
 
Method Summary
 void clear()
          Remove all nodes from the queue
 Node dequeue()
          Remove a node from the top of the queue
 void enqueue(Node v)
          Add a node to the end of the queue
 boolean isEmpty()
          Check if the collection contains any elements.
 NodeIterator iterator()
          Return an iterator through all nodes in the collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListAsNodeQueue

public ListAsNodeQueue()
Constructor. Use a java.util.LinkedList internally.


ListAsNodeQueue

public ListAsNodeQueue(List<Node> l)
Constructor. Use the given List object internally.

Parameters:
l - the list to be used as queue
Method Detail

enqueue

public void enqueue(Node v)
Description copied from interface: NodeQueue
Add a node to the end of the queue

Specified by:
enqueue in interface NodeQueue
Parameters:
v - the node to be added

dequeue

public Node dequeue()
Description copied from interface: NodeQueue
Remove a node from the top of the queue

Specified by:
dequeue in interface NodeQueue
Returns:
the node which has been removed from the top of the queue

iterator

public NodeIterator iterator()
Description copied from interface: FixedNodeCollection
Return an iterator through all nodes in the collection.

Specified by:
iterator in interface FixedNodeCollection
Returns:
iterator

isEmpty

public boolean isEmpty()
Description copied from interface: FixedNodeCollection
Check if the collection contains any elements.

Specified by:
isEmpty in interface FixedNodeCollection
Returns:
true if empty.

clear

public void clear()
Description copied from interface: NodeQueue
Remove all nodes from the queue

Specified by:
clear in interface NodeQueue