com.tomgibara.pronto.control
Interface EngineControlAdapter<S,L,P>


public interface EngineControlAdapter<S,L,P>

Implementations of this interface provide a controller with string representations of a state engine's labels. The label names returned from this interface must, by default, match the following pattern:

^[\p{javaLowerCase}\p{javaUpperCase}\p{Digit}-_]+$

This pattern can be changed via the pronto static properties.

It is strongly advised (though not mandatory) that the mapping provided be one-to-one.

Author:
Tom Gibara

Method Summary
 L labelFromName(java.lang.String name)
          Returns the label with the supplied name.
 java.lang.String nameFromLabel(L label)
          Provides a string representation of a supplied label.
 P parseParameter(java.lang.String string)
          Returns a parameter string that is supplied to the controller into a parameter object that can be used to perform transitions.
 

Method Detail

nameFromLabel

java.lang.String nameFromLabel(L label)
Provides a string representation of a supplied label.

Parameters:
label - a label in the controller's state graph
Returns:
the name for the label, or null if the label has no name

labelFromName

L labelFromName(java.lang.String name)
Returns the label with the supplied name.

Parameters:
name - a name supplied to the controller
Returns:
the label so named, or null if there is no label with that name

parseParameter

P parseParameter(java.lang.String string)
                 throws java.text.ParseException
Returns a parameter string that is supplied to the controller into a parameter object that can be used to perform transitions.

Parameters:
string - the string representation of the parameter that was supplied to the controller, or null if there was no parameter specified
Returns:
the parameter object that corresponds to the supplied string, or null
Throws:
java.text.ParseException - if the supplied string could not be parsed into a valid parameter object


Copyright © 2006-2007 Tom Gibara. All Rights Reserved.