nextgrid.api.pom
Interface ControlProcess

All Superinterfaces:
java.lang.Cloneable, Process, java.io.Serializable
All Known Subinterfaces:
AsyncProcess, DoWhileProcess, IfThenElseProcess, LoopProcess, RepeatUntilProcess, SequenceProcess, SplitJoinProcess, UnorderedListProcess, WhileDoProcess

public interface ControlProcess
extends Process

Type description.

Author:
Rodrigo Ruiz

Method Summary
 void addChildren(int index, Process child)
          Inserts the specified element at the specified position in this list.
 void addChildren(Process... processes)
          Adds a set of processes to the child list.
 int getChildCount()
          Gets the number of child processes.
 Process[] getChildren()
          Gets the processes in the children list.
 Process getChildren(int index)
          Gets a child process by its index.
 Reference<?> getLocalVar(java.lang.String name)
          Gets a reference used by this process as a local variable.
 java.util.Map<java.lang.String,Reference<?>> getLocalVars()
          Gets the collection of all local variables defined in the scope of this process instance.
 boolean isLazy()
          Gets the lazy flag value.
 boolean isMemoizeActive()
          Gets the memoize flag value.
 Process removeChild(int index)
          Removes the element at the specified position in this list.
 boolean removeChild(Process child)
          Removes a process instance from the children list.
 void setChildren(int index, Process child)
          Sets a child process.
 void setChildren(Process... children)
          Sets the list of child processes for this process instance.
 void setLazy(boolean lazy)
          Sets the value of the lazy flag.
 void setLocalVar(java.lang.String name, Reference<?> value)
          Sets a reference used by this process as a local variable.
 void setMemoizeActive(boolean memoize)
          Sets the memoize flag value.
 void trim(int count)
          Sets the size of the children list to a maximum of count items.
 
Methods inherited from interface nextgrid.api.pom.Process
addListener, copy, discover, enact, evaluate, findProcessById, findRoot, getAttribute, getAttribute, getAttribute, getAttributes, getDescription, getId, getInput, getInputs, getInputType, getName, getOutput, getOutputs, getOutputType, getParent, getUsedInputNames, getUsedOutputNames, invalidate, isEvaluated, isValidated, prioritise, putInput, putOutput, removeInput, removeListener, removeOutput, reset, setAttribute, setAttribute, setDescription, setId, setName, setParent, unuseInput, unuseOutput, useInput, useOutput, validate
 

Method Detail

isLazy

boolean isLazy()
Gets the lazy flag value.

This flag allows certqain control over the evaluation recursion level at runtime.

Specified by:
isLazy in interface Process
Returns:
The flag value

setLazy

void setLazy(boolean lazy)
Sets the value of the lazy flag.

This flag allows certqain control over the evaluation recursion level at runtime.

Specified by:
setLazy in interface Process
Parameters:
lazy - The flag value

isMemoizeActive

boolean isMemoizeActive()
Gets the memoize flag value.

This flag determines if previous children evaluations will be reused for multiple executions. This is the case of loops, for example, in which the contained subworkflow may be reused among iteration steps.

Returns:
The flag value

setMemoizeActive

void setMemoizeActive(boolean memoize)
Sets the memoize flag value.

This flag determines if previous children evaluations will be reused for multiple executions. This is the case of loops, for example, in which the contained subworkflow may be reused among iteration steps.

Parameters:
memoize - The flag value

getChildren

Process[] getChildren()
Gets the processes in the children list.

Returns:
An array of child processes

getChildren

Process getChildren(int index)
Gets a child process by its index.

Parameters:
index - The child process position
Returns:
The process

getChildCount

int getChildCount()
Gets the number of child processes.

Returns:
the number of child processes

trim

void trim(int count)
Sets the size of the children list to a maximum of count items.

It correctly removes all items from position count to the end of the list. If the list is already smaller than count, it does nothing.

Parameters:
count - The max number of elements to maintain in the children list

setChildren

void setChildren(Process... children)
Sets the list of child processes for this process instance.

Parameters:
children - An array of processes

setChildren

void setChildren(int index,
                 Process child)
Sets a child process.

Parameters:
index - The position in the list
child - The process to set
Throws:
java.lang.UnsupportedOperationException - If the process does not support children

addChildren

void addChildren(int index,
                 Process child)
Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Parameters:
index - index at which the specified element is to be inserted.
child - element to be inserted.
Throws:
java.lang.UnsupportedOperationException - if the add method is not supported by this list.
java.lang.ClassCastException - if the class of the specified element prevents it from being added to this list.
java.lang.IllegalArgumentException - if some aspect of the specified element prevents it from being added to this list.
java.lang.IndexOutOfBoundsException - index is out of range (index < 0 || index > size()).

addChildren

void addChildren(Process... processes)
Adds a set of processes to the child list.

Parameters:
processes - The processes to add

removeChild

Process removeChild(int index)
Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.

Parameters:
index - the index of the element to remove
Returns:
the element previously at the specified position
Throws:
java.lang.UnsupportedOperationException - if the remove method is not supported by this list.
java.lang.IndexOutOfBoundsException - if the specified index is out of range (index < 0 || index >= size()).

removeChild

boolean removeChild(Process child)
Removes a process instance from the children list.

Parameters:
child - The process to remove
Returns:
true if it is removed

getLocalVar

Reference<?> getLocalVar(java.lang.String name)
Gets a reference used by this process as a local variable.

Control processes can contain a set of "local variables", which are references not directly used by this process, but by its children.

Iterative constructs may use this collection for resetting their values in each loop iteration.

Parameters:
name - Variable name
Returns:
Reference to the variable

setLocalVar

void setLocalVar(java.lang.String name,
                 Reference<?> value)
Sets a reference used by this process as a local variable.

Parameters:
name - Variable name
value - Reference to the variable value

getLocalVars

java.util.Map<java.lang.String,Reference<?>> getLocalVars()
Gets the collection of all local variables defined in the scope of this process instance.

Returns:
A collection containing all local variables in this instance


Copyright © 2006-2008 Grid Systems, S.A.. All Rights Reserved.