uk.ac.man.cs.rainbow.rapa.gcl
Class Rule

java.lang.Object
  |
  +--uk.ac.man.cs.rainbow.rapa.gcl.Rule
All Implemented Interfaces:
LatexGenerator, Serializable, VariableContainer

public class Rule
extends Object
implements Serializable, VariableContainer, LatexGenerator

A single GCL rule.

See Also:
Serialized Form

Constructor Summary
Rule(ArrayList guards, ArrayList actions, ArrayList updates)
           
Rule(Value[] guards, Action[] actions)
           
Rule(Value[] guards, Action[] actions, Assignment update)
           
Rule(Value[] guards, Action[] actions, Assignment[] updates)
           
Rule(Value[] guards, Assignment[] updates)
           
Rule(Value guard, Value[] context, Action[] actions, Assignment update)
           
Rule(Value guard, Value[] context, Assignment update)
           
 
Method Summary
protected  void append(StringBuffer s)
           
 void appendLaTeX(StringBuffer s)
          Append a LATEX representation of this object to the given buffer.
 Rule apply(Unifier u)
           
 boolean contains(Assignment update)
           
 boolean contains(Value guard)
           
 boolean equals(Object o)
           
 Action[] getActions()
           
 Action getActions(int i)
           
 char[] getGuardDescriptor()
           
 Value[] getGuards()
           
 Value getGuards(int i)
           
 char[] getUpdateDescriptor()
           
 Assignment[] getUpdates()
           
 Assignment getUpdates(int i)
           
 int hashCode()
           
 boolean hasVariable()
           
static boolean isCompatibleActions(Action[] act1, Action[] act2)
           
static boolean isCompatibleDescriptor(char[] desc1, char[] desc2)
           
 int numActions()
           
 int numGuards()
           
 int numUpdates()
           
 Rule subst(Assignment.StateVar.Subst s)
           
 Rule subst(GeneralSubstitution s)
           
 Rule subst(ProgramCounterFactory factory, int i, int n1, int n2)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rule

public Rule(Value[] guards,
            Action[] actions,
            Assignment[] updates)

Rule

public Rule(Value[] guards,
            Action[] actions,
            Assignment update)

Rule

public Rule(Value[] guards,
            Assignment[] updates)

Rule

public Rule(Value guard,
            Value[] context,
            Assignment update)

Rule

public Rule(Value guard,
            Value[] context,
            Action[] actions,
            Assignment update)

Rule

public Rule(Value[] guards,
            Action[] actions)

Rule

public Rule(ArrayList guards,
            ArrayList actions,
            ArrayList updates)
Method Detail

getGuards

public Value[] getGuards()

getGuards

public Value getGuards(int i)

numGuards

public int numGuards()

getActions

public Action[] getActions()

getActions

public Action getActions(int i)

numActions

public int numActions()

getUpdates

public Assignment[] getUpdates()

getUpdates

public Assignment getUpdates(int i)

numUpdates

public int numUpdates()

subst

public Rule subst(GeneralSubstitution s)

apply

public Rule apply(Unifier u)

subst

public Rule subst(ProgramCounterFactory factory,
                  int i,
                  int n1,
                  int n2)

subst

public Rule subst(Assignment.StateVar.Subst s)

contains

public boolean contains(Value guard)

contains

public boolean contains(Assignment update)

append

protected void append(StringBuffer s)

appendLaTeX

public void appendLaTeX(StringBuffer s)
Description copied from interface: LatexGenerator
Append a LATEX representation of this object to the given buffer.
Specified by:
appendLaTeX in interface LatexGenerator

toString

public String toString()
Overrides:
toString in class Object

getGuardDescriptor

public char[] getGuardDescriptor()

getUpdateDescriptor

public char[] getUpdateDescriptor()

isCompatibleDescriptor

public static boolean isCompatibleDescriptor(char[] desc1,
                                             char[] desc2)

isCompatibleActions

public static boolean isCompatibleActions(Action[] act1,
                                          Action[] act2)

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

hasVariable

public boolean hasVariable()
Specified by:
hasVariable in interface VariableContainer