SMC
6_0_1

net.sf.smc.model
Class SmcElement

java.lang.Object
  extended by net.sf.smc.model.SmcElement
Direct Known Subclasses:
SmcAction, SmcFSM, SmcGuard, SmcMap, SmcParameter, SmcState, SmcTransition

public abstract class SmcElement
extends java.lang.Object

The super class for all abstract syntax tree elements. Provides the interface for the visitor classes. See the Visitor pattern in GoF (p. 331).

See Also:
SmcFSM, SmcMap, SmcState, SmcTransition, SmcGuard, SmcAction, SmcParameter, SmcVisitor

Nested Class Summary
static class SmcElement.TransType
          The SMC transitions fall into four types.
 
Field Summary
protected  int _lineNumber
          The line number where this element is defined in the .sm file.
protected  java.lang.String _name
          An element has a unique name.
static java.lang.String NIL_STATE
          Inner loopback transitions use "nil" as their destination state.
 
Constructor Summary
protected SmcElement(java.lang.String name, int lineNumber)
          Default constructor.
 
Method Summary
abstract  void accept(SmcVisitor visitor)
          Accepts a new visitor which performs some action upon this abstract syntax tree element.
 int getLineNumber()
          Returns the element's position in the .sm file.
 java.lang.String getName()
          Returns the element's unique name.
static java.util.List<SmcTransition> merge(java.util.List<SmcTransition> l1, java.util.List<SmcTransition> l2, java.util.Comparator<SmcTransition> c)
          Returns an ordered transition list with no repeated entries by merging two transition lists together.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_name

protected final java.lang.String _name
An element has a unique name.


_lineNumber

protected final int _lineNumber
The line number where this element is defined in the .sm file.


NIL_STATE

public static final java.lang.String NIL_STATE
Inner loopback transitions use "nil" as their destination state.

See Also:
Constant Field Values
Constructor Detail

SmcElement

protected SmcElement(java.lang.String name,
                     int lineNumber)
Default constructor.

Parameters:
name - the elements unique name.
lineNumber - where this element appears in the .sm file.
Method Detail

accept

public abstract void accept(SmcVisitor visitor)
Accepts a new visitor which performs some action upon this abstract syntax tree element.

Parameters:
visitor - a parser visitor.

getName

public java.lang.String getName()
Returns the element's unique name.

Returns:
the element's unique name.

getLineNumber

public int getLineNumber()
Returns the element's position in the .sm file.

Returns:
the element's position in the .sm file.

merge

public static java.util.List<SmcTransition> merge(java.util.List<SmcTransition> l1,
                                                  java.util.List<SmcTransition> l2,
                                                  java.util.Comparator<SmcTransition> c)
Returns an ordered transition list with no repeated entries by merging two transition lists together.

Parameters:
l1 - The first transition list.
l2 - The second transition list.
c - Transition comparator.
Returns:
an ordered transition list with no repeated entries by merging two transition lists together.

SMC
6_0_1

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