bin
Class InstinctException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by bin.InstinctException
All Implemented Interfaces:
java.io.Serializable

public class InstinctException
extends java.lang.Exception

InstinctException Class

This class is used to handle any exceptions during parsing of any files that are generated/loaded into AI Builder.

Version:
0.1 - Initial Release
Author:
Richard John Sproston [ richard.sproston@gmail.com || lucky_jackpot@hotmail.com ]
See Also:
Serialized Form

Constructor Summary
InstinctException()
          Default Constructor for this class with no parameters.
InstinctException(java.lang.String errorMessage)
          Default Constructor for class with 1 parameter.
InstinctException(java.lang.String errorMessage, int lineNumber)
          Default Constructor for class, with 2 parameters.
InstinctException(java.lang.String errorMessage, int lineNumber, int numParams, java.lang.String currentInstinctParams)
          Default Constructor for class, with 4 parameters.
 
Method Summary
 
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
 

Constructor Detail

InstinctException

public InstinctException()
Default Constructor for this class with no parameters.


InstinctException

public InstinctException(java.lang.String errorMessage)
Default Constructor for class with 1 parameter.

Parameters:
errorMessage - The error message to display.

InstinctException

public InstinctException(java.lang.String errorMessage,
                         int lineNumber)
Default Constructor for class, with 2 parameters.

This exception method is triggered by the Parser class, if it encounters any white space before an AI instinct (usually in an imported file).

With AI Builder, the superclass is GUIFramework (as may be witnessed in its attempt to "try/catch" this type of exception).

Parameters:
errorMessage - This is the error String that will be passed "onwards and upwards" to the superclass.

InstinctException

public InstinctException(java.lang.String errorMessage,
                         int lineNumber,
                         int numParams,
                         java.lang.String currentInstinctParams)
Default Constructor for class, with 4 parameters.

This exception method is triggered by the Parser class, if it encounters a syntax error with a particular AI instinct (this will always be due to an invalid number of parameters for the instinct in question).

With AI Builder, the superclass is GUIFramework (as may be witnessed in its attempt to "try/catch" this type of exception).

Parameters:
errorMessage - The descriptive error message that is to be displayed.
lineNumber - The particular line number where the parsing error occurred. Useful for JK editor debugging.
numParams - This informs the JK editor how many parameters are expected for this instinct.
currentInstinctParams - This details the parameters that the Instinct expected to find (but obviously didn't).