AMPLException

public class AMPLException extends RuntimeException

Represent an exception generated by AMPL

Fields

isWarning

boolean isWarning

line

int line

Constructors

AMPLException

AMPLException(String message, boolean isWarning)

Constructor

Parameters:
  • message – Message

AMPLException

AMPLException(String message, int line, int offset, String name, Source s, boolean isWarning)

Construct an exception from an AMPL error

Parameters:
  • error

AMPLException

public AMPLException(Exception ex)

Construct an AMPLException from an inner exception

Parameters:
  • ex – Inner exception

Methods

getLineNumber

public int getLineNumber()

Returns the line number where the exception occurred. Line numbers starts from 1.

Returns:An integer representing the line number, or 0 if none is available.

getMessage

public String getMessage()

Returns a message for this error.

Returns:The error or warning message.

getOffset

public int getOffset()

Returns the offset, from the beginning of the last executed group of statements where the exception occurred.

Returns:An integer representing the offset, or 0 if none is available.

getSourceName

public String getSourceName()

Returns the name of the source where the exception occurred.

Returns:A string containing the name, or null if none is available.

toString

public String toString()