org.openstreetmap.osmosis.core.pipeline.common
Class PipeTasks

java.lang.Object
  extended by org.openstreetmap.osmosis.core.pipeline.common.PipeTasks

public class PipeTasks
extends java.lang.Object

Maintains the tasks that have been registered as producing data during the connection process.

Author:
Brett Henderson

Constructor Summary
PipeTasks()
          Creates a new instance.
 
Method Summary
 int defaultTaskSize()
          Returns how many default pipes are stored in this container.
 java.util.Set<java.lang.String> getPipeNames()
          Returns the names of all of the currently registered pipes.
 void putTask(java.lang.String taskId, java.lang.String pipeName, Task task)
          Adds the specified task using the specified name.
 void putTask(java.lang.String taskId, Task task)
          Adds the specified task to the default pipe list.
 Task retrieveTask(java.lang.String taskId, java.lang.Class<? extends Task> requiredTaskType)
          Removes and returns the next available task registered under a default name.
 Task retrieveTask(java.lang.String taskId, java.lang.String pipeName, java.lang.Class<? extends Task> requiredTaskType)
          Removes and returns the task registered under the specified name.
 int size()
          Returns the number of pipes stored in this container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PipeTasks

public PipeTasks()
Creates a new instance.

Method Detail

putTask

public void putTask(java.lang.String taskId,
                    java.lang.String pipeName,
                    Task task)
Adds the specified task using the specified name.

Parameters:
taskId - The unique identifier of the task perfroming this request.
pipeName - The name to register the task under.
task - The task to be added.

putTask

public void putTask(java.lang.String taskId,
                    Task task)
Adds the specified task to the default pipe list.

Parameters:
taskId - The unique identifier of the task performing this request.
task - The task to be added.

retrieveTask

public Task retrieveTask(java.lang.String taskId,
                         java.lang.String pipeName,
                         java.lang.Class<? extends Task> requiredTaskType)
Removes and returns the task registered under the specified name.

Parameters:
taskId - The unique identifier of the task perfroming this request.
pipeName - The name of the registered task.
requiredTaskType - The required type of the input task.
Returns:
The matching task.

retrieveTask

public Task retrieveTask(java.lang.String taskId,
                         java.lang.Class<? extends Task> requiredTaskType)
Removes and returns the next available task registered under a default name.

Parameters:
taskId - The unique identifier of the task perfroming this request.
requiredTaskType - The required type of the input task.
Returns:
The matching task.

size

public int size()
Returns the number of pipes stored in this container.

Returns:
The number of pipes.

defaultTaskSize

public int defaultTaskSize()
Returns how many default pipes are stored in this container. This is a subset of the count returned by size().

Returns:
The number of default pipes.

getPipeNames

public java.util.Set<java.lang.String> getPipeNames()
Returns the names of all of the currently registered pipes.

Returns:
The set of pipe names.