com.googlecode.sarasvati
Enum ExecutionType

java.lang.Object
  extended by java.lang.Enum<ExecutionType>
      extended by com.googlecode.sarasvati.ExecutionType
All Implemented Interfaces:
Serializable, Comparable<ExecutionType>

public enum ExecutionType
extends Enum<ExecutionType>

Specifies the different execution types. During normal execution, only Forward is used. The other execution types are using when backtracking (see Engine.backtrack(NodeToken).

Author:
Paul Lorenz

Enum Constant Summary
Backtracked
          Indicates that the associated token was generated during a backtracking operation, as part of the reverse execution.
Forward
          Indicates that the associated token was generated via normal execution and has not been backtracked.
ForwardBacktracked
          Indicates that the associated token was generated via normal execution but has since been backtracked.
UTurn
          Indicates that the associated token was generated during a backtracking operation, on an arc token which was backtracked but not as far as the previous node.
UTurnBacktracked
          Indicates that the associated token was generated during a backtracking operation, as a U-turn and has now been backtracked as part of a second backtrack operation.
 
Method Summary
 ExecutionType getCorrespondingBacktracked(boolean isComplete)
          Returns the backtracked version of the execution type, or itself if the execution type is already a backtracking type.
 boolean isBacktracked()
          Returns true if the execution type indicates that the token has been backtracked and false otherwise.
static ExecutionType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ExecutionType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

Forward

public static final ExecutionType Forward
Indicates that the associated token was generated via normal execution and has not been backtracked.


ForwardBacktracked

public static final ExecutionType ForwardBacktracked
Indicates that the associated token was generated via normal execution but has since been backtracked.


Backtracked

public static final ExecutionType Backtracked
Indicates that the associated token was generated during a backtracking operation, as part of the reverse execution.


UTurn

public static final ExecutionType UTurn
Indicates that the associated token was generated during a backtracking operation, on an arc token which was backtracked but not as far as the previous node. Execution on this arc therefore looks somewhat like a u-turn, where entry and exit are both on the exit side.


UTurnBacktracked

public static final ExecutionType UTurnBacktracked
Indicates that the associated token was generated during a backtracking operation, as a U-turn and has now been backtracked as part of a second backtrack operation.

Method Detail

values

public static ExecutionType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ExecutionType c : ExecutionType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ExecutionType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getCorrespondingBacktracked

public ExecutionType getCorrespondingBacktracked(boolean isComplete)
Returns the backtracked version of the execution type, or itself if the execution type is already a backtracking type.

Parameters:
isComplete - Indicates if the associated token is complete
Returns:
The backtracked version of the execution type.

isBacktracked

public boolean isBacktracked()
Returns true if the execution type indicates that the token has been backtracked and false otherwise.

Returns:
True if the execution type indicates that the token has been backtracked and false otherwise.