Package org.prolog4j
Class UnknownVariableException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.prolog4j.UnknownVariableException
-
- All Implemented Interfaces:
Serializable
public class UnknownVariableException extends RuntimeException
This exception is thrown when a syntactically incorrect Prolog query is processed.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UnknownVariableException(String variable)
Constructs an UnknownVariableException.UnknownVariableException(String variable, Throwable cause)
Constructs an UnknownVariableException.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getVariable()
Returns the name of the variable that caused the exception.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
UnknownVariableException
public UnknownVariableException(String variable)
Constructs an UnknownVariableException. It takes the name of the absent variable as its argument. The exception is thrown when you want to get the value of a variable that does not occur in the query being processed.- Parameters:
variable
- the name of the variable whose value was required but does not exist in the query
-
UnknownVariableException
public UnknownVariableException(String variable, Throwable cause)
Constructs an UnknownVariableException. It takes the name of the absent variable as its first argument. The exception is thrown when you want to get the value of a variable that does not occur in the query being processed. It takes the original exception (that has been thrown by the inherent Prolog implementation) as another argument.- Parameters:
variable
- the name of the variable whose value was required but does not exist in the querycause
- the original exception thrown by the implementation
-
-
Method Detail
-
getVariable
public String getVariable()
Returns the name of the variable that caused the exception.- Returns:
- the name of the variable that is absent in the query being processed
-
-