PostScriptLine
Date: 2016-04-28

org.apache.xmlgraphics.ps.dsc.events

## Class PostScriptLine

- java.lang.Object
- - org.apache.xmlgraphics.ps.dsc.events.AbstractEvent
  - - org.apache.xmlgraphics.ps.dsc.events.PostScriptLine

- All Implemented Interfaces:
    DSCParserConstants, DSCEvent

      public class PostScriptLine
      extends AbstractEvent

  Represents a line of PostScript code.

- - ### Field Summary

    - ### Fields inherited from interface org.apache.xmlgraphics.ps.dsc.DSCParserConstants

      `COMMENT, DSC_COMMENT, EOF, HEADER_COMMENT, LINE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PostScriptLine(java.lang.String line)` Creates a new instance.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `PostScriptLine` | `asLine()` Casts this instance to a PostScriptLine if possible.
    `void` | `generate(PSGenerator gen)` Writes the event to the given PSGenerator.
    `int` | `getEventType()` Returns the event type.
    `java.lang.String` | `getLine()` Returns the code line.
    `boolean` | `isLine()` Indicates whether the instance is a PostScript line.

    - ### Methods inherited from class org.apache.xmlgraphics.ps.dsc.events.AbstractEvent

      `asDSCComment, isComment, isDSCComment, isHeaderComment`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PostScriptLine

          public PostScriptLine(java.lang.String line)

      Creates a new instance.
      Parameters:
        `line` - the code line

  - ### Method Detail

    - #### getLine

          public java.lang.String getLine()

      Returns the code line.
      Returns:
        the code line

    - #### generate

          public void generate(PSGenerator gen)
                        throws java.io.IOException

      Description copied from interface: `DSCEvent`
      Writes the event to the given PSGenerator.
      Parameters:
        `gen` - the PSGenerator to write to
      Throws:
        `java.io.IOException` - In case of an I/O error
      See Also:
        `DSCEvent.generate(org.apache.xmlgraphics.ps.PSGenerator)`

    - #### getEventType

          public int getEventType()

      Description copied from interface: `DSCEvent`
      Returns the event type.
      Returns:
        the event type (see `DSCParserConstants`)
      See Also:
        `DSCEvent.getEventType()`

    - #### asLine

          public PostScriptLine asLine()

      Description copied from interface: `DSCEvent`
      Casts this instance to a PostScriptLine if possible.
      Specified by:
        `asLine` in interface `DSCEvent`
      Overrides:
        `asLine` in class `AbstractEvent`
      Returns:
        this event as a PostScriptLine
      See Also:
        `AbstractEvent.asLine()`

    - #### isLine

          public boolean isLine()

      Description copied from interface: `DSCEvent`
      Indicates whether the instance is a PostScript line.
      Specified by:
        `isLine` in interface `DSCEvent`
      Overrides:
        `isLine` in class `AbstractEvent`
      Returns:
        true if the instance is a PostScript line
      See Also:
        `AbstractEvent.isLine()`