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
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
Action
public Action(Channel chan,
Value value,
int kind)
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
.