AMPLOutput

public class AMPLOutput

Captures an AMPL message together with its kind, as fetched from the underlying modelling system.

Fields

error

AMPLException error

errors

static String errors

isErrorOrWarning

boolean isErrorOrWarning

isWarning

boolean isWarning

kind

String kind

kindEnum

Kind kindEnum

message

String message

source

Source source

warnings

static final String[] warnings

Constructors

AMPLOutput

AMPLOutput(String kind, String message, Source s)

Constructor

Parameters:
  • kind – Kind of message as per AMPL -b option
  • message – Message contents

Methods

getError

AMPLException getError()

Get the error captured by this AMPLOutput.

Throws:

getKind

public Kind getKind()

getMessage

public String getMessage()
Returns:The message

isBreak

Boolean isBreak()

Returns true if the message is a recovery from break kind=break...

Returns:True if the message is a break (AMPL has been interrupted)

isErrorOrWarning

boolean isErrorOrWarning()

isExit

Boolean isExit()

Returns true if the message is an exit message kind=exit...

Returns:True if the message is an exit (AMPL has quit)

isInvalidSubscript

boolean isInvalidSubscript()

isOption

Boolean isOption()

Returns true if the message is an option kind=option...

isPrompt

Boolean isPrompt()

Returns true if the message is any prompt kind=prompt...

Returns:True if the message is a prompt

isWaiting

Boolean isWaiting()

Returns true if AMPL is waiting for a statement delimiter (;) kind=prompt2

Returns:True if AMPL is waiting for the end of a statement

isWarning

boolean isWarning()

toString

public String toString()

Get the string representation of this output, in the form: `kind`: `message`