uk.ac.starlink.table.formats

## Class RowEvaluator.Decoder<T>

- java.lang.Object
- - uk.ac.starlink.table.formats.RowEvaluator.Decoder<T>

- Enclosing class:
    RowEvaluator

      public abstract static class RowEvaluator.Decoder<T>
      extends java.lang.Object

  Interface for an object that can turn a string into a cell content object.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Decoder(java.lang.Class<T> clazz, java.lang.String name)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ColumnInfo` | `createColumnInfo(java.lang.String name)` Returns a new ColumnInfo suitable for the decoded values.
    `abstract T` | `decode(java.lang.String value)` Decodes a value.
    `java.lang.Class<T>` | `getDecodedClass()` Returns the class to which this decoder decodes.
    `java.lang.String` | `getName()` Returns the name of this decoder.
    `abstract boolean` | `isValid(java.lang.String value)` Indicates whether this decoder is capable of decoding a given string.

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

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

- - ### Constructor Detail

    - #### Decoder

          public Decoder(java.lang.Class<T> clazz,
                         java.lang.String name)

      Constructor.
      Parameters:
        `clazz` - class of object to be returned by decode method
        `name` - instance name

  - ### Method Detail

    - #### getDecodedClass

          public java.lang.Class<T> getDecodedClass()

      Returns the class to which this decoder decodes.
      Returns:
        destination class

    - #### getName

          public java.lang.String getName()

      Returns the name of this decoder.
      Returns:
        name

    - #### createColumnInfo

          public ColumnInfo createColumnInfo(java.lang.String name)

      Returns a new ColumnInfo suitable for the decoded values.
      Parameters:
        `name` - column name
      Returns:
        new metadata object

    - #### decode

          public abstract T decode(java.lang.String value)

      Decodes a value. Will complete without exception if `isValid(java.lang.String)` returns true for the presented `value`; otherwise may throw an unchecked exception.
      Parameters:
        `value` - string to decode
      Returns:
        typed object corresponding to `value`

    - #### isValid

          public abstract boolean isValid(java.lang.String value)

      Indicates whether this decoder is capable of decoding a given string.
      Parameters:
        `value` - string to decode
      Returns:
        true iff this decoder can make sense of the string