de.esprit.appsuite.nio.ascii

## Class AsciiWord

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.appsuite.nio.ascii.AsciiWord

- All Implemented Interfaces:
    Clearable, Dumpable

      public final class AsciiWord
      extends DumpableObject
      implements Clearable

  This class represents a word that was read in by the `AsciiParser`.
  Author:
    Thomas Stecher, Rainer Buesch

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected byte[]` | `data`
    `protected int` | `length`
    `protected int` | `position`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AsciiWord(byte[] data)`
    `AsciiWord(java.lang.String text)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `asBytes()`
    `double` | `asDouble()` Converts the current buffer content to a double value.
    `int` | `asInt()` Converts the current buffer content to an integer value.
    `long` | `asLong()` Converts the current buffer content to a long value.
    `short` | `asShort()` Converts the current buffer content to a short value.
    `java.lang.String` | `asString()`
    `void` | `checkDouble()` Performs a fast check whether the current buffer content could be converted to a double value.
    `void` | `checkLong()` Performs a fast check whether the current buffer content could be converted to a long value.
    `void` | `clear()` Clears the content
    `void` | `copyData(AsciiWord word)`
    `boolean` | `equals(java.lang.Object obj)`
    `boolean` | `equalsIgnoreCase(byte[] bytes)`
    `boolean` | `equalsIgnoreCase(java.lang.String text)`
    `byte` | `getByteAt(int index)`
    `int` | `hashCode()`
    `void` | `setEncoding(java.lang.String encoding)` Defines the character encoding to be used.
    `protected void` | `setMarkers(int position, int length)`
    `ToString` | `toString(ToString s)` This method allows subclasses to add values to the existing ToString of the superclass.

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### data

          protected final byte[] data

    - #### position

          protected int position

    - #### length

          protected int length

  - ### Constructor Detail

    - #### AsciiWord

          public AsciiWord(java.lang.String text)

    - #### AsciiWord

          public AsciiWord(byte[] data)

  - ### Method Detail

    - #### copyData

          public final void copyData(AsciiWord word)

    - #### clear

          public final void clear()

      Description copied from interface: `Clearable`
      Clears the content
      Specified by:
        `clear` in interface `Clearable`

    - #### checkLong

          public final void checkLong()

      Performs a fast check whether the current buffer content could be converted to a long value.
      Throws:
        `java.lang.ArithmeticException` - if conversion fails.

    - #### asLong

          public final long asLong()

      Converts the current buffer content to a long value.
      Throws:
        `java.lang.ArithmeticException` - if conversion fails.

    - #### asInt

          public final int asInt()

      Converts the current buffer content to an integer value.
      Throws:
        `java.lang.ArithmeticException` - if conversion fails.

    - #### asShort

          public final short asShort()

      Converts the current buffer content to a short value.
      Throws:
        `java.lang.ArithmeticException` - if conversion fails.

    - #### checkDouble

          public final void checkDouble()

      Performs a fast check whether the current buffer content could be converted to a double value.
      Throws:
        `java.lang.ArithmeticException` - if conversion fails.

    - #### asDouble

          public final double asDouble()

      Converts the current buffer content to a double value.
      Throws:
        `java.lang.ArithmeticException` - if conversion fails.

    - #### setMarkers

          protected void setMarkers(int position,
                        int length)

    - #### getByteAt

          public final byte getByteAt(int index)

    - #### asBytes

          public final byte[] asBytes()

    - #### asString

          public final java.lang.String asString()

    - #### setEncoding

          public void setEncoding(java.lang.String encoding)

      Defines the character encoding to be used. If not set, then the default platform encoding is used.

    - #### equalsIgnoreCase

          public final boolean equalsIgnoreCase(java.lang.String text)

    - #### equalsIgnoreCase

          public final boolean equalsIgnoreCase(byte[] bytes)

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### toString

          public ToString toString(ToString s)

      Description copied from interface: `Dumpable`
      This method allows subclasses to add values to the existing ToString of the superclass. Usually subclasses only need to override this method.
      Specified by:
        `toString` in interface `Dumpable`
      Overrides:
        `toString` in class `DumpableObject`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.