org.millscript.millscript.functions
Class UnaryFunction

java.lang.Object
  extended by org.millscript.millscript.functions.Function
      extended by org.millscript.millscript.functions.UnaryFunction
Direct Known Subclasses:
BindingMatchedFunction, BindingMatchVarCountFunction, BindingOriginalRegExFunction, BindingOriginalStringFunction

public abstract class UnaryFunction
extends Function

This class the common functionality required for a single argument function which returns a single result. This class allows simple unary functions to be implemented very easily.


Constructor Summary
UnaryFunction()
           
UnaryFunction(Package p)
           
 
Method Summary
 void apply(Machine mc, int nargs)
          Performs this function using the specified machine, with the specified number of arguments.
abstract  java.lang.Object apply1(java.lang.Object a1)
          Returns the result of this function when applied to the single specified arguments.
 
Methods inherited from class org.millscript.millscript.functions.Function
applyUpdater, checkNargs, checkNargsGT, checkUNargs, getName, modName, reportNargsError, reportNargsGTError, setName, toString, tryClone
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnaryFunction

public UnaryFunction()
See Also:
Function.Function()

UnaryFunction

public UnaryFunction(Package p)
See Also:
Function.Function(Package)
Method Detail

apply

public void apply(Machine mc,
                  int nargs)
Description copied from class: Function
Performs this function using the specified machine, with the specified number of arguments.

Specified by:
apply in class Function
Parameters:
mc - the machine to perform this function on
nargs - the number of arguments the function is being invoked with
See Also:
Function.apply(org.millscript.millscript.vm.Machine, int)

apply1

public abstract java.lang.Object apply1(java.lang.Object a1)
Returns the result of this function when applied to the single specified arguments.

Parameters:
a1 - the argument to the function
Returns:
the result of applying this function to the argument


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