org.millscript.millscript.functions
Class FunctionAlert

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.millscript.commons.alert.Alert
                  extended by org.millscript.millscript.functions.FunctionAlert
All Implemented Interfaces:
java.io.Serializable

public class FunctionAlert
extends org.millscript.commons.alert.Alert

This class implements an Alert to indicate a problem executing a function.

See Also:
Serialized Form

Constructor Summary
FunctionAlert(java.lang.String comp, java.lang.String exp)
          Constructs a new function alert with the specified complaint and explanation.
 
Method Summary
 FunctionAlert culpritArg(int argNumber, java.lang.Object arg)
          Adds a culprit for an argument to a function, as specified by the supplied argument position and value.
 FunctionAlert culpritArgs(Function f, Machine mc, int nargs)
          Gathers the specified function and number of arguments as culprits of this alert.
 FunctionAlert culpritUArgs(Function f, Machine mc, int nargs, int unargs)
          Gathers the specified function, number of arguments and update arguments as culprits of this alert.
static FunctionAlert eval(java.lang.String comp, java.lang.String exp)
          Convenience method for constructing a new alert with the specified complaint and explanation in the evaluation phase.
 
Methods inherited from class org.millscript.commons.alert.Alert
culprit, culprit, culprit, culprit, culprit, culprit, culprit, culprit, decorate, decorate, escape, getComplaint, getCulprits, getMessage, getParentAlert, getParentThrowable, getPhase, getReason, isMishap, mishap, origin, remishap, report, setParentAlert, setParentThrowable, setPhase, toString
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FunctionAlert

public FunctionAlert(java.lang.String comp,
                     java.lang.String exp)
Constructs a new function alert with the specified complaint and explanation.

Parameters:
comp - the complaint
exp - the complaints explanation
Method Detail

culpritArg

public FunctionAlert culpritArg(int argNumber,
                                java.lang.Object arg)
Adds a culprit for an argument to a function, as specified by the supplied argument position and value.

Parameters:
argNumber - the arguments position
arg - the arguments value
Returns:
this function alert

culpritArgs

public FunctionAlert culpritArgs(Function f,
                                 Machine mc,
                                 int nargs)
Gathers the specified function and number of arguments as culprits of this alert.

Parameters:
f - the culprit function
mc - the machine to gather culprit arguments from
nargs - the number of culprit arguments
Returns:
this alert with function and argument culprits

culpritUArgs

public FunctionAlert culpritUArgs(Function f,
                                  Machine mc,
                                  int nargs,
                                  int unargs)
Gathers the specified function, number of arguments and update arguments as culprits of this alert.

Parameters:
f - the culprit function
mc - the machine to gather culprit arguments from
nargs - the number of culprit arguments
unargs - the number of culprit update arguments
Returns:
this alert with function and argument culprits

eval

public static FunctionAlert eval(java.lang.String comp,
                                 java.lang.String exp)
Convenience method for constructing a new alert with the specified complaint and explanation in the evaluation phase.

Parameters:
comp - the complaint
exp - the explanation for the complaint
Returns:
a new alert with the specified complaint and explanation


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