org.millscript.millscript.action
Class UnaryOpAction

java.lang.Object
  extended by org.millscript.millscript.action.Action
      extended by org.millscript.millscript.action.UnaryOpAction
All Implemented Interfaces:
org.millscript.commons.alert.AlertOrigin
Direct Known Subclasses:
ConstantLeftAddAction, ConstantLeftDivAction, ConstantLeftModAction, ConstantLeftMulAction, ConstantLeftSubAction, ConstantRightAddAction, ConstantRightDivAction, ConstantRightModAction, ConstantRightMulAction, ConstantRightSubAction

public abstract class UnaryOpAction
extends Action

This class is the base of all unary actions, i.e. those that operate on a single value.


Constructor Summary
protected UnaryOpAction(Action a)
          Constructs a new unary action, for the specified action.
 
Method Summary
 void action(Machine mc)
          Performs this action, on the specified machine.
abstract  java.lang.Object perform(java.lang.Object x)
          Performs this binary action on the specified value.
 
Methods inherited from class org.millscript.millscript.action.Action
act, act1, getLineNumber, getOrigin, predAct, setContext, setLineNumber, setOrigin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnaryOpAction

protected UnaryOpAction(Action a)
Constructs a new unary action, for the specified action.

Parameters:
a - the single action
Method Detail

perform

public abstract java.lang.Object perform(java.lang.Object x)
Performs this binary action on the specified value.

Parameters:
x - the unary value
Returns:
the result of this unary action

action

public final void action(Machine mc)
Description copied from class: Action
Performs this action, on the specified machine. This method must be implemented in sub-classes to perform the required actions.

Specified by:
action in class Action
Parameters:
mc - the machine to perform this action on
See Also:
Action.action(org.millscript.millscript.vm.Machine)


Copyright © 2001-2007 Open World Ltd. All Rights Reserved.