org.eclipse.emf.henshin.model
Class Action

java.lang.Object
  extended by org.eclipse.emf.henshin.model.Action

public final class Action
extends Object

This class represents an action of a GraphElement. Actions consist of:

Since version 0.9.3, the syntax of actions is as follows: ...

Some basic examples (all examples shown with surrounding «..»):

Examples of named positive and negative application conditions (PACs and NACs):

Examples of (nested) multi-rules:


Nested Class Summary
static class Action.Type
          An enum for action types.
 
Field Summary
static char FRAGMENT_START
          Fragment marker.
static char MULTI_MARKER
          Multi-flag marker.
static char PATH_SEPARATOR
          Separator for paths.
 
Constructor Summary
Action(Action.Type type)
          Constructor without multi-flag, path and fragment.
Action(Action.Type type, boolean isMulti)
          Constructor without path and fragment.
Action(Action.Type type, boolean isMulti, String[] path)
          Constructor without fragment.
Action(Action.Type type, boolean isMulti, String[] path, String fragment)
          Constructor.
 
Method Summary
 boolean equals(Object object)
           
 String getFragment()
          Returns the fragment of this action or null if it does not have a fragment.
 String[] getPath()
          Returns path this action contains.
 Action.Type getType()
          Returns the type of this action.
 int hashCode()
           
 boolean hasSameFragment(Action action)
          Returns true if this action has the same fragment as the argument action.
 boolean hasSameMultiFlag(Action action)
          Returns true if this action has the same multi-flag as the argument action.
 boolean hasSamePath(Action action)
          Returns true if this action has the same path as the argument action.
 boolean hasSameType(Action action)
          Returns true if this action has the same type as the argument action.
 boolean isMulti()
          Get the multi flag.
static Action parse(String value)
          Parses an action string for graph elements.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PATH_SEPARATOR

public static final char PATH_SEPARATOR
Separator for paths.

See Also:
Constant Field Values

MULTI_MARKER

public static final char MULTI_MARKER
Multi-flag marker.

See Also:
Constant Field Values

FRAGMENT_START

public static final char FRAGMENT_START
Fragment marker.

See Also:
Constant Field Values
Constructor Detail

Action

public Action(Action.Type type,
              boolean isMulti,
              String[] path,
              String fragment)
Constructor.

Parameters:
type - Action type.
isMulti - Multi flag.
path - Path.
fragment - Fragment.

Action

public Action(Action.Type type,
              boolean isMulti,
              String[] path)
Constructor without fragment.

Parameters:
type - Action type.
isMulti - Multi flag.
path - Path.

Action

public Action(Action.Type type,
              boolean isMulti)
Constructor without path and fragment.

Parameters:
type - Action type.
isMulti - Multi flag.

Action

public Action(Action.Type type)
Constructor without multi-flag, path and fragment.

Parameters:
type - Action type.
Method Detail

parse

public static Action parse(String value)
                    throws ParseException
Parses an action string for graph elements.

Parameters:
value - String representation of the action.
Returns:
The parsed element action.
Throws:
ParseException - On parse errors.

getType

public Action.Type getType()
Returns the type of this action. This never returns null.

Returns:
The action type.

isMulti

public boolean isMulti()
Get the multi flag.

Returns:
Multi flag.

getPath

public String[] getPath()
Returns path this action contains. If no path was specified, this method returns an empty string array. This never returns null.

Returns:
The path.

getFragment

public String getFragment()
Returns the fragment of this action or null if it does not have a fragment.

Returns:
The fragment or null.

hasSameType

public boolean hasSameType(Action action)
Returns true if this action has the same type as the argument action.

Parameters:
action - An action.
Returns:
true if it has the same type.

hasSameMultiFlag

public boolean hasSameMultiFlag(Action action)
Returns true if this action has the same multi-flag as the argument action.

Parameters:
action - An action.
Returns:
true if it has the same multi-flag.

hasSamePath

public boolean hasSamePath(Action action)
Returns true if this action has the same path as the argument action.

Parameters:
action - An action.
Returns:
true if it has the same path.

hasSameFragment

public boolean hasSameFragment(Action action)
Returns true if this action has the same fragment as the argument action.

Parameters:
action - An action.
Returns:
true if it has the same fragment.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object