Overview | Package | Class | Tree | Deprecated | Index | Help
| SMC 6_0_1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sf.smc.model
Class SmcAction

    java.lang.Object
      net.sf.smc.model.SmcElement
          net.sf.smc.model.SmcAction

All Implemented Interfaces:
  java.lang.Comparable<SmcAction>

    public final class SmcAction

extends SmcElement
implements java.lang.Comparable<SmcAction>

Actions are used in both transtions and state Entry and Exit clauses. Actions are implemented as methods in the FSM's context class.

Actions have two properties:

1. Property: if this flag is `true`, then the action was a property assignment (var = value). This action is supported only for C# and VB.Net target compilation.
2. Arguments: the action's arguments copied verbatim from the SMC code. The SMC parser does not attempt to interpret the actions beyond requiring that the arguments are a comma-separated list.

Nested Class Summary

Nested classes/interfaces inherited from class net.sf.smc.model.SmcElement
`SmcElement.TransType`

Field Summary

Fields inherited from class net.sf.smc.model.SmcElement
`_lineNumber, _name, NIL_STATE`

Constructor Summary
`SmcAction(java.lang.String name, int lineNumber)` Creates the named action appearing on the given .sm line.
`SmcAction(java.lang.String name, int lineNumber, boolean propertyFlag, java.util.List<java.lang.String> arguments)` Creates an action with all data members specified.

Method Summary
`void` | `accept(SmcVisitor visitor)` Pass this action to the visitor for processing.
`int` | `compareTo(SmcAction action)` Returns an integer value <, = or > zero depending on whether this action is <, = or > `action`.
`java.util.List<java.lang.String>` | `getArguments()` Returns the action's argument list.
`boolean` | `isEmptyStateStack()` Returns `true` if this action is the predefined EmptyStateStack() Returns `false` if this action is not the predefined EmptyStateStack()
`boolean` | `isProperty()` Returns `true` if this action is a .Net property assignment and `false` if not.
`boolean` | `isStatic()` Returns `true` if this action is a static member.
`void` | `setArguments(java.util.List<java.lang.String> args)` Sets the action's arguments.
`void` | `setProperty(boolean flag)` If `flag` is `true`, then this action is a .Net property assignment.
`java.lang.String` | `toString()` Returns a textual representation of this action.

Methods inherited from class net.sf.smc.model.SmcElement
`getLineNumber, getName, merge`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### SmcAction

    public SmcAction(java.lang.String name,
                     int lineNumber)

  Creates the named action appearing on the given .sm line. The action has no arguments and is not a property assignment by default.

  Parameters:
    `name` - the action's name should correspond to the FSM context method.
    `lineNumber` - where the action appears in the .sm file.

### SmcAction

    public SmcAction(java.lang.String name,
                     int lineNumber,
                     boolean propertyFlag,
                     java.util.List<java.lang.String> arguments)
              throws java.lang.IllegalArgumentException

  Creates an action with all data members specified.

  Parameters:
    `name` - the action's name should correspond to the FSM context method.
    `lineNumber` - where the action appears in the .sm file.
    `propertyFlag` - if `true`, then this action is a .Net property assignment and `arguments` must be a non-`null` list with exactly one item.
    `arguments` - the action's arguments. May be `null`.
  Throws:
    `java.lang.IllegalArgumentException` - if `propertyFlag` is `true` and `arguments` is either `null` or does not contain exactly one item.

Method Detail

### accept

    public void accept(SmcVisitor visitor)

  Pass this action to the visitor for processing. Part of the Visitor pattern.

  Specified by:
    `accept` in class `SmcElement`
  Parameters:
    `visitor` - the object implementing the visit(SmcElement) method.

### compareTo

    public int compareTo(SmcAction action)

  Returns an integer value <, = or > zero depending on whether this action is <, = or > `action`. The comparison is based on the action name and arguments.

  Specified by:
    `compareTo` in interface `java.lang.Comparable<SmcAction>`
  Parameters:
    `action` - comparison action object.
  Returns:
    an integer value <, = or > zero depending on whether this action is <, = or > `action`.

### isProperty

    public boolean isProperty()

  Returns `true` if this action is a .Net property assignment and `false` if not.

  Returns:
    `true` if this action is a .Net property assignment and `false` if not.

### isStatic

    public boolean isStatic()

  Returns `true` if this action is a static member. Returns `false` if this action is an instance member.

### isEmptyStateStack

    public boolean isEmptyStateStack()

  Returns `true` if this action is the predefined EmptyStateStack() Returns `false` if this action is not the predefined EmptyStateStack()

### getArguments

    public java.util.List<java.lang.String> getArguments()

  Returns the action's argument list. May return `null`.

  Returns:
    the action's argument list. May return `null`.

### setProperty

    public void setProperty(boolean flag)

  If `flag` is `true`, then this action is a .Net property assignment.

  Parameters:
    `flag` - if `true`, then this action is a .Net property assignment.

### setArguments

    public void setArguments(java.util.List<java.lang.String> args)
                      throws java.lang.IllegalArgumentException

  Sets the action's arguments.

  Parameters:
    `args` - the action's arguments. May be `null`.
  Throws:
    `java.lang.IllegalArgumentException` - if this is a property action and `arguments` is either `null` or does not contain exactly one item.

### toString

    public java.lang.String toString()

  Returns a textual representation of this action. If this is a .Net property, the format is "<name> = <argument>". Otherwise the format is "<name>(<arg0>[, <argn>])".

  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    a textual representation of this action.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SMC 6_0_1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009. Charles W. Rapp. All Rights Reserved. Use is subject to license terms.