uk.ac.man.cs.rainbow.rapa.data
Class Action

java.lang.Object
  |
  +--uk.ac.man.cs.rainbow.rapa.data.Action
All Implemented Interfaces:
Cloneable, Serializable, VariableContainer

public class Action
extends Object
implements Cloneable, Serializable, VariableContainer

An event that happens on a channel.

See Also:
Channel, Value, Serialized Form

Field Summary
static int INPUT
           
static int OUTPUT
           
static int POSTIN
           
static int POSTOUT
           
static int POSTTAU
           
static int TAU
           
 
Constructor Summary
Action(Channel chan, Value value, int kind)
           
 
Method Summary
 Action apply(Unifier u)
           
 Object clone()
           
 Action combine(Action act)
          Combine actions to produce a tau action.
 boolean equals(Object o)
           
 Channel getChan()
           
 int getKind()
           
 Unifier getUnifier(Action a)
           
 Value getValue()
           
 int hashCode()
           
 boolean hasVariable()
           
static Action Input(Channel chan, Value value)
           
 boolean isInput()
           
 boolean isOutput()
           
 boolean isPostponed()
           
 boolean isTau()
           
 void notifyListeners()
          Sends a suitable message to all listeners registered with the action's channel.
static Action Output(Channel chan, Value value)
           
 Action postpone()
           
 Action subst(GeneralSubstitution s)
           
 Action subst(Substitution s)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

INPUT

public static final int INPUT

OUTPUT

public static final int OUTPUT

TAU

public static final int TAU

POSTIN

public static final int POSTIN

POSTOUT

public static final int POSTOUT

POSTTAU

public static final int POSTTAU
Constructor Detail

Action

public Action(Channel chan,
              Value value,
              int kind)
Method Detail

getChan

public Channel getChan()

getValue

public Value getValue()

getKind

public int getKind()

isInput

public boolean isInput()

isOutput

public boolean isOutput()

isTau

public boolean isTau()

isPostponed

public boolean isPostponed()

Input

public static Action Input(Channel chan,
                           Value value)

Output

public static Action Output(Channel chan,
                            Value value)

toString

public String toString()
Overrides:
toString in class Object

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

subst

public Action subst(Substitution s)

apply

public Action apply(Unifier u)

getUnifier

public Unifier getUnifier(Action a)
                   throws NotUnifiable

subst

public Action subst(GeneralSubstitution s)

clone

public Object clone()
Overrides:
clone in class Object

combine

public Action combine(Action act)
Combine actions to produce a tau action.
Parameters:
act - Action to combine with this one.
Returns:
Combined action if actions are combinable, and null otherwise.

hasVariable

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

postpone

public Action postpone()

notifyListeners

public void notifyListeners()
Sends a suitable message to all listeners registered with the action's channel.
Throws:
RainbowError - If the kind of this action is not TAU, POSTOUT or POSTTAU.