org.umber.catalan.process.queue
Class DefaultQueue

java.lang.Object
  extended byorg.umber.catalan.process.queue.DefaultQueue
All Implemented Interfaces:
IPropertyHolder, IQueue

public class DefaultQueue
extends java.lang.Object
implements IQueue

A collection of processing nodes. Can be read-only or read/write. Includes a IQueue-wide property Map.

Author:
jsheets

Constructor Summary
DefaultQueue()
          Creates a new instance of a writable DefaultQueue with no properties.
DefaultQueue(IQueue queue)
          Creates a new instance as a copy of the given queue.
DefaultQueue(java.util.List nodes)
          Creates a new instance of a writable DefaultQueue with the queue nodes.
DefaultQueue(java.util.List nodes, IWorkProperties properties, boolean writable)
          Creates a new instance of DefaultQueue with a work property set.
 
Method Summary
 java.util.List getNodes()
          Retrieves the current node processing list.
 IWorkProperties getProperties()
          Retrieves the container for all properties currently set in the workspace.
 boolean isReadOnly()
          Determines if a queue is read-only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultQueue

public DefaultQueue()
Creates a new instance of a writable DefaultQueue with no properties.


DefaultQueue

public DefaultQueue(IQueue queue)
Creates a new instance as a copy of the given queue.

Parameters:
queue - source queue to load this queue with

DefaultQueue

public DefaultQueue(java.util.List nodes)
Creates a new instance of a writable DefaultQueue with the queue nodes.

Parameters:
nodes - initial set of nodes

DefaultQueue

public DefaultQueue(java.util.List nodes,
                    IWorkProperties properties,
                    boolean writable)
Creates a new instance of DefaultQueue with a work property set.

Parameters:
nodes - initial set of nodes
properties - IPropertyHolder properties
writable - true to allow modification of queue nodes
Method Detail

getProperties

public IWorkProperties getProperties()
Retrieves the container for all properties currently set in the workspace.

Specified by:
getProperties in interface IPropertyHolder
Returns:
all workspace properties

getNodes

public java.util.List getNodes()
Retrieves the current node processing list.

Specified by:
getNodes in interface IQueue
Returns:
the current node list

isReadOnly

public boolean isReadOnly()
Determines if a queue is read-only. The nodes of a read-only queue can be examined, but not moved around. Any attempts to add or remove nodes will trigger an UnsupportedOperationException.

Note: Operations on the nodes themselves cannot be screened out, so a read-only queue is only truly read-only if all of its nodes are immutable.

Specified by:
isReadOnly in interface IQueue
Returns:
true if queue is read-only