org.norther.tammi.spray.template.flow
Interface FlowStep

All Known Implementing Classes:
DefaultFlowStep, ReadOnlyFlowStep

public interface FlowStep

An interface to flow steps.

Author:
Ilkka Priha

Field Summary
static char CURRENT_FLOW_INDICATOR
          The current flow indicator char.
static char FLOW_PATH_SEPARATOR
          The flow path separator char.
static char STEP_INDEX_SEPARATOR
          The step index separator char.
static char STEP_PATH_SEPARATOR
          The step path separator char.
 
Method Summary
 void addStateListener(StepStateListener listener)
          Adds a state listener of this flow step.
 void addStepName(int index, String name)
          Adds a named flow step.
 void addVariable(int index, Variable var)
          Adds a new variable at the specified index.
 void addVariable(Variable var)
          Adds a new variable.
 boolean containsInvalidVariables()
          Returns true, if there are one or more invalid variables.
 void disposeFlows()
          Disposes flows of this flow step and their resources.
 void disposeSteps()
          Disposes steps of this flow step and their resources.
 String getAbsolutePath()
          Gets the absolute path to this flow step.
 List getActionNames()
          Gets the action names.
 FlowStep getFlow()
          Gets the flow of this flow step.
 int getIndex()
          Gets the index of this flow step.
 String getLabel()
          Gets the label.
 String getName()
          Gets the name of this flow step.
 String getPath()
          Gets the relative path to this flow step.
 String getProperty(int index)
          Gets the indexed property.
 StepMatrix getRouteMatrix()
          Gets the step route matrix.
 FlowStep getStep(int index)
          Gets the indexed flow step
 String getStepName(int index)
          Gets the name of the indexed flow step.
 List getStepNames()
          Gets the names of flow steps.
 String getStepPath(int index)
          Gets the relative path to the indexed flow step.
 String getTemplate()
          Gets the template.
 List getTemplatePaths()
          Gets the template paths.
 String getTransition(int index)
          Gets the indexed transition.
 Variable getVariable(int index)
          Gets the indexed variable.
 List getVariables()
          Gets the variables.
 List getVariableTypes()
          Gets the variable types.
 int indexOfStep(String name)
          Returns the index of the named flow step.
 boolean isHeritable()
          Checks whether heritable.
 boolean isInvalidVariable(int index)
          Checks the invalidity of the indexed variable.
 boolean isState(int index)
          Checks the indexed state.
 boolean isValidVariable(int index)
          Checks the validity of the indexed variable.
 boolean isValidVariables()
          Checks whether all variables are valid, i.e.
 void removeStateListener(StepStateListener listener)
          Removes a state listener of this flow step.
 void removeStep(int index)
          Removes the indexed flow step.
 void removeTemplate()
          Removes the template.
 void removeVariable(int index)
          Removes the indexed variable.
 void removeVariables()
          Removes all variables.
 Variable renewVariable(int index)
          Renews the indexed variable by replacing it with a fresh one.
 List renewVariables()
          Renews all variables by replacing them with fresh ones.
 void resetInvalidVariables()
          Resets invalid variables by marking them as not updated.
 void resetVariable(int index)
          Resets the indexed variable by marking it as not updated.
 void resetVariables()
          Resets all variables by marking them as not updated.
 void setActionNames(List tasks)
          Sets the action names.
 void setHeritable(boolean flag)
          Sets whether heritable.
 void setLabel(String label)
          Sets the label.
 String setProperty(int index, String value)
          Sets the indexed property.
 void setRouteMatrix(StepMatrix matrix)
          Sets the step route matrix.
 boolean setState(int index, boolean flag)
          Sets the indexed state.
 void setStepName(int index, String name)
          Sets the named flow step.
 void setStepNames(List names)
          Sets the names of flow steps.
 void setTemplate(String path)
          Sets the template.
 void setTemplatePaths(List paths)
          Sets the template paths.
 String setTransition(int index, String value)
          Sets the indexed transition.
 void setValidVariable(int index, boolean flag)
          Sets the validity of the indexed variable.
 void setValidVariables(boolean flag)
          Sets the validity of all variables.
 void setVariable(int index, Variable var)
          Sets the indexed variable.
 void setVariables(List list)
          Sets the variables.
 void setVariableTypes(List types)
          Sets the variable types.
 void sortVariables(Comparator comparator)
          Sorts variables.
 int stepCount()
          Returns the number of steps.
 String toClassName()
          Converts the name of this flow to the corresponding class name.
 int variableCount()
          Returns the number of variables.
 

Field Detail

CURRENT_FLOW_INDICATOR

static final char CURRENT_FLOW_INDICATOR
The current flow indicator char.

See Also:
Constant Field Values

FLOW_PATH_SEPARATOR

static final char FLOW_PATH_SEPARATOR
The flow path separator char.

See Also:
Constant Field Values

STEP_PATH_SEPARATOR

static final char STEP_PATH_SEPARATOR
The step path separator char.

See Also:
Constant Field Values

STEP_INDEX_SEPARATOR

static final char STEP_INDEX_SEPARATOR
The step index separator char.

See Also:
Constant Field Values
Method Detail

getName

String getName()
Gets the name of this flow step.

Returns:
the flow name.

getFlow

FlowStep getFlow()
Gets the flow of this flow step.

Returns:
the flow.

getIndex

int getIndex()
Gets the index of this flow step.

Returns:
the step index.

getPath

String getPath()
Gets the relative path to this flow step.

Returns:
the relative step path.

getAbsolutePath

String getAbsolutePath()
Gets the absolute path to this flow step.

Returns:
the absolute step path.

isHeritable

boolean isHeritable()
Checks whether heritable.

Returns:
true if heritable, false otherwise.

setHeritable

void setHeritable(boolean flag)
Sets whether heritable.

Parameters:
flag - true if heritable, false otherwise.

getRouteMatrix

StepMatrix getRouteMatrix()
Gets the step route matrix.

Returns:
the step matrix.

setRouteMatrix

void setRouteMatrix(StepMatrix matrix)
Sets the step route matrix.

Parameters:
matrix - the step matrix.
Throws:
IndexOutOfBoundsException - if wrong size.

getStep

FlowStep getStep(int index)
Gets the indexed flow step

Parameters:
index - the index.
Returns:
the flow step.
Throws:
IndexOutOfBoundsException - if wrong index.
IllegalStateException - if not available.

removeStep

void removeStep(int index)
Removes the indexed flow step.

Parameters:
index - the index.
Throws:
IllegalArgumentException - for an index <= 0.
IndexOutOfBoundsException - if wrong index.

indexOfStep

int indexOfStep(String name)
Returns the index of the named flow step.

Parameters:
name - the flow step name.
Returns:
the index of the step or -1.

getStepName

String getStepName(int index)
Gets the name of the indexed flow step.

Parameters:
index - the index.
Returns:
the name of the flow step.
Throws:
IndexOutOfBoundsException - if wrong index.

setStepName

void setStepName(int index,
                 String name)
Sets the named flow step.

Parameters:
index - the index.
name - the flow step name.
Throws:
NullPointerException - for a null name.
IllegalArgumentException - for invalid index or name.
IndexOutOfBoundsException - if wrong index.

addStepName

void addStepName(int index,
                 String name)
Adds a named flow step.

Parameters:
index - the index.
name - the flow step name.
Throws:
NullPointerException - for a null name.
IllegalArgumentException - for invalid index or name.
IndexOutOfBoundsException - if wrong index.

getStepNames

List getStepNames()
Gets the names of flow steps.

Returns:
a read-only list of flow step names or null.

setStepNames

void setStepNames(List names)
Sets the names of flow steps.

Parameters:
names - a list of flow step names.
Throws:
NullPointerException - for null names.
IllegalArgumentException - for invalid names.

getStepPath

String getStepPath(int index)
Gets the relative path to the indexed flow step.

Parameters:
index - the index.
Returns:
the relative step path.
Throws:
IndexOutOfBoundsException - if wrong index.

stepCount

int stepCount()
Returns the number of steps.

Returns:
the number of steps.

disposeSteps

void disposeSteps()
Disposes steps of this flow step and their resources.


disposeFlows

void disposeFlows()
Disposes flows of this flow step and their resources.


toClassName

String toClassName()
Converts the name of this flow to the corresponding class name.

Returns:
the flow name in the class name format.

getLabel

String getLabel()
Gets the label.

Note that the name is returned if the label is not set.

Returns:
the label.

setLabel

void setLabel(String label)
Sets the label.

Parameters:
label - the label.

getTemplatePaths

List getTemplatePaths()
Gets the template paths.

Returns:
a list of template paths or null.

setTemplatePaths

void setTemplatePaths(List paths)
Sets the template paths.

Parameters:
paths - a list of template paths.

getVariableTypes

List getVariableTypes()
Gets the variable types.

Returns:
a list of variable types.

setVariableTypes

void setVariableTypes(List types)
Sets the variable types.

Parameters:
types - a list of variable types or null.

getActionNames

List getActionNames()
Gets the action names.

Returns:
a list of action names.

setActionNames

void setActionNames(List tasks)
Sets the action names.

Parameters:
tasks - a list of action names or null.

isState

boolean isState(int index)
Checks the indexed state.

Note that the index depends on the context of this flow step.

Parameters:
index - the state index.
Returns:
true if set, false otherwise.

setState

boolean setState(int index,
                 boolean flag)
Sets the indexed state.

Note that the index depends on the context of this flow step.

Parameters:
index - the state index.
flag - true if set, false otherwise.
Returns:
the previous value of the state.

getProperty

String getProperty(int index)
Gets the indexed property.

Note that the index depends on the context of this flow step.

Parameters:
index - the property index.
Returns:
the value of the property or null.

setProperty

String setProperty(int index,
                   String value)
Sets the indexed property.

Note that the index depends on the context of this flow step.

Parameters:
index - the property index.
value - the value of the property.
Returns:
the previous value of the property.

getTransition

String getTransition(int index)
Gets the indexed transition.

Note that the index depends on the context of this flow step.

Parameters:
index - the state index.
Returns:
the value of the transition or null.

setTransition

String setTransition(int index,
                     String value)
Sets the indexed transition.

Note that the index depends on the context of this flow step.

Parameters:
index - the state index.
value - the value of the transition.
Returns:
the previous value of the transition.

addStateListener

void addStateListener(StepStateListener listener)
Adds a state listener of this flow step.

Parameters:
listener - the listener.

removeStateListener

void removeStateListener(StepStateListener listener)
Removes a state listener of this flow step.

Parameters:
listener - the listener.

getTemplate

String getTemplate()
Gets the template. The template is either the set one or the first one of the defined template paths.

Returns:
the template or null.

setTemplate

void setTemplate(String path)
Sets the template. The template has precedence over the first one of the defined template paths, but doesn't replace it.

Parameters:
path - the template path.

removeTemplate

void removeTemplate()
Removes the template. Only the set template is removed, not the defined template paths.


getVariable

Variable getVariable(int index)
                     throws ConstructionException
Gets the indexed variable.

Parameters:
index - the index of the variable.
Returns:
the variable.
Throws:
ConstructionException - if construction fails.
IndexOutOfBoundsException - for wrong index.
IllegalStateException - if the flow filter is missing.

setVariable

void setVariable(int index,
                 Variable var)
                 throws ConstructionException
Sets the indexed variable.

Parameters:
index - the index of the variable.
var - the variable.
Throws:
ConstructionException - if construction fails.
IndexOutOfBoundsException - for wrong index.
IllegalStateException - if the flow filter is missing.

getVariables

List getVariables()
                  throws ConstructionException
Gets the variables.

Returns:
a read-only list of variables.
Throws:
ConstructionException - if construction fails.
IllegalStateException - if the flow filter is missing.

setVariables

void setVariables(List list)
Sets the variables.

Parameters:
list - a list of variables.

addVariable

void addVariable(Variable var)
                 throws ConstructionException
Adds a new variable.

Parameters:
var - the variable.
Throws:
ConstructionException - if construction fails.
NullPointerException - for a null variable.
IllegalStateException - if the flow filter is missing.

addVariable

void addVariable(int index,
                 Variable var)
                 throws ConstructionException
Adds a new variable at the specified index.

Parameters:
index - the index of the variable.
var - the variable.
Throws:
ConstructionException - if construction fails.
IndexOutOfBoundsException - for wrong index.
NullPointerException - for a null variable.
IllegalStateException - if the flow filter is missing.

renewVariable

Variable renewVariable(int index)
                       throws ConstructionException
Renews the indexed variable by replacing it with a fresh one.

Parameters:
index - the index of the variable.
Returns:
the variable.
Throws:
ConstructionException - if construction fails.
IndexOutOfBoundsException - for wrong index.
IllegalStateException - if the flow filter is missing.

renewVariables

List renewVariables()
                    throws ConstructionException
Renews all variables by replacing them with fresh ones.

Returns:
a read-only list of variable MBeans.
Throws:
ConstructionException - if construction fails.
IllegalStateException - if the flow filter is missing.

removeVariable

void removeVariable(int index)
                    throws ConstructionException
Removes the indexed variable.

Parameters:
index - the index of the variable.
Throws:
ConstructionException - if construction fails.
IndexOutOfBoundsException - for wrong index.
IllegalStateException - if the flow filter is missing.

removeVariables

void removeVariables()
                     throws ConstructionException
Removes all variables.

Throws:
ConstructionException - if construction fails.
IllegalStateException - if the flow filter is missing.

sortVariables

void sortVariables(Comparator comparator)
                   throws ConstructionException
Sorts variables.

Parameters:
comparator - the comparator to apply.
Throws:
ConstructionException - if construction fails.
IllegalStateException - if the flow filter is missing.

variableCount

int variableCount()
Returns the number of variables.

Returns:
the number of variables.

isValidVariable

boolean isValidVariable(int index)
Checks the validity of the indexed variable.

Parameters:
index - the index of the variable.
Returns:
true if valid, false otherwise.
Throws:
IndexOutOfBoundsException - for wrong index.

isInvalidVariable

boolean isInvalidVariable(int index)
Checks the invalidity of the indexed variable.

Parameters:
index - the index of the variable.
Returns:
true if invalid, false otherwise.
Throws:
IndexOutOfBoundsException - for wrong index.

setValidVariable

void setValidVariable(int index,
                      boolean flag)
Sets the validity of the indexed variable.

Parameters:
index - the inded of the variable.
flag - true if valid, false otherwise.
Throws:
IndexOutOfBoundsException - for wrong index.

isValidVariables

boolean isValidVariables()
Checks whether all variables are valid, i.e. updated and not invalid.

Returns:
true if valid, false otherwise.

setValidVariables

void setValidVariables(boolean flag)
Sets the validity of all variables.

Parameters:
flag - true if valid, false otherwise.

resetVariable

void resetVariable(int index)
Resets the indexed variable by marking it as not updated.

Parameters:
index - the index of the variable.
Throws:
IndexOutOfBoundsException - for wrong index.

resetVariables

void resetVariables()
Resets all variables by marking them as not updated.


containsInvalidVariables

boolean containsInvalidVariables()
Returns true, if there are one or more invalid variables.

Returns:
true if invalid, false otherwise.

resetInvalidVariables

void resetInvalidVariables()
Resets invalid variables by marking them as not updated.



Copyright © 2004 The Norther Organization. All rights reserved.