Error (API documentation of hlt.language packages)
Date: 2013-01-30

hlt.language.util

## Class Error

- java.lang.Object
- - hlt.language.util.Error

- All Implemented Interfaces:
    Locatable

      public class Error
      extends java.lang.Object
      implements Locatable

  This is the class of objects representing errors.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Error()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Location` | `getEnd()` Returns the end of this error's extent as a `Location`.
    `Locatable` | `getExtent()` Returns this error's extent as a `Locatable`.
    `java.lang.String` | `getLabel()` Returns the string that labels this error's printed form (default = `"Error: "`).
    `java.lang.String` | `getMsg()` Returns the string of this error's message (default = `"an error happened"`).
    `java.lang.String` | `getPrefix()` Returns the string that starts this error's printed form (default = `"*** "`).
    `java.lang.String` | `getSee()` Returns the string indicating this error's extent (default = `" - see "`).
    `Location` | `getStart()` Returns the start of this error's extent as a `Location`.
    `boolean` | `isWarning()` Returns true if this error in only a warning.
    `java.lang.String` | `locationString()` Returns an explicit String describing the location of this error's extent.
    `Error` | `makeWarning()` Qualifies this error as only a warning, and returns this error.
    `Locatable` | `setEnd(Location location)` Sets the end of this error's extent to the specified `Location` and returns this.
    `Error` | `setExtent(Locatable extent)` Sets this error's extent to the specified `Locatable`, and returns this error.
    `Error` | `setLabel(java.lang.String label)` Sets this error's label to the specified String, and returns this error.
    `Error` | `setMsg(java.lang.String msg)` Sets this error's message to the specified String, and returns this error.
    `Error` | `setPrefix(java.lang.String prefix)` Sets this error's prefix to the specified String, and returns this error.
    `Error` | `setSee(java.lang.String see)` Sets this error's the string indicating this error's extent the specified String, and returns this error.
    `Locatable` | `setStart(Location location)` Sets the start of this error's extent to the specified `Location` and returns this.
    `java.lang.String` | `toString()` Returns a String composed of all the elements of this error in the form: `getPrefix()+getLabel()+getMsg()+getSee()+locationString()`.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Error

          public Error()

  - ### Method Detail

    - #### getPrefix

          public final java.lang.String getPrefix()

      Returns the string that starts this error's printed form (default = `"*** "`).

    - #### setPrefix

          public final Error setPrefix(java.lang.String prefix)

      Sets this error's prefix to the specified String, and returns this error.

    - #### getLabel

          public final java.lang.String getLabel()

      Returns the string that labels this error's printed form (default = `"Error: "`).

    - #### setLabel

          public final Error setLabel(java.lang.String label)

      Sets this error's label to the specified String, and returns this error.

    - #### getMsg

          public final java.lang.String getMsg()

      Returns the string of this error's message (default = `"an error happened"`).

    - #### setMsg

          public final Error setMsg(java.lang.String msg)

      Sets this error's message to the specified String, and returns this error.

    - #### getSee

          public final java.lang.String getSee()

      Returns the string indicating this error's extent (default = `" - see "`).

    - #### setSee

          public final Error setSee(java.lang.String see)

      Sets this error's the string indicating this error's extent the specified String, and returns this error.

    - #### getExtent

          public final Locatable getExtent()

      Returns this error's extent as a `Locatable`.

    - #### setExtent

          public final Error setExtent(Locatable extent)

      Sets this error's extent to the specified `Locatable`, and returns this error.

    - #### isWarning

          public final boolean isWarning()

      Returns true if this error in only a warning.

    - #### makeWarning

          public final Error makeWarning()

      Qualifies this error as only a warning, and returns this error.

    - #### getStart

          public final Location getStart()

      Returns the start of this error's extent as a `Location`.
      Specified by:
        `getStart` in interface `Locatable`

    - #### getEnd

          public final Location getEnd()

      Returns the end of this error's extent as a `Location`.
      Specified by:
        `getEnd` in interface `Locatable`

    - #### setStart

          public final Locatable setStart(Location location)

      Sets the start of this error's extent to the specified `Location` and returns this.
      Specified by:
        `setStart` in interface `Locatable`

    - #### setEnd

          public final Locatable setEnd(Location location)

      Sets the end of this error's extent to the specified `Location` and returns this.
      Specified by:
        `setEnd` in interface `Locatable`

    - #### locationString

          public java.lang.String locationString()

      Returns an explicit String describing the location of this error's extent. The default is `getExtent().locationString()` if this error's extent is non `null`, or the empty string othetwise. This method may be overridden.
      Specified by:
        `locationString` in interface `Locatable`

    - #### toString

          public java.lang.String toString()

      Returns a String composed of all the elements of this error in the form: `getPrefix()+getLabel()+getMsg()+getSee()+locationString()`. Thus, the default is `"*** Error: an error happened - see "+locationString()`. This method may be overridden.
      Overrides:
        `toString` in class `java.lang.Object`