com.sun.slamd.scripting.engine
Class BreakException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bycom.sun.slamd.scripting.engine.ScriptException
              extended bycom.sun.slamd.scripting.engine.BreakException
All Implemented Interfaces:
java.io.Serializable

public class BreakException
extends ScriptException

This class defines a special kind of script exception that may be thrown if a break instruction is encountered inside a loop. The break exception indicates that the execution of the loop should terminate and that executions should resume at the first instruction immediately after the end of the loop. It is necessary to implement this as an exception because a loop may have multiple depths of instructions and when the break is called it will be necessary to break out of all of them. To deal with the performance penalty that can be associated with exceptions (particularly, filling in the stack trace which is not even important in this case), a static singleton instance will be created that should be thrown instead of creating a new break exception every time.

See Also:
Serialized Form

Field Summary
static BreakException BREAK
          The singleton instance of this exception that should be thrown whenever a break is necessary.
 
Methods inherited from class com.sun.slamd.scripting.engine.ScriptException
getParentException
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BREAK

public static final BreakException BREAK
The singleton instance of this exception that should be thrown whenever a break is necessary.