de.esprit.appsuite.nio.ndf

## Class NdfTable

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.appsuite.nio.ndf.NdfTable

- All Implemented Interfaces:
    Dumpable

      public class NdfTable
      extends DumpableObject

  This class encapsulates the definition of a table. It includes the tableName, all it's columnNames as well as formatting information for each column.
  This class serves as an iterator over the columns.
  Author:
    Rainer Buesch

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `NdfTable.Alignment`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NdfTable(java.lang.String tableName)`
    `NdfTable(java.lang.String tableName, NdfProperties props)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addColumn(java.lang.String column)` Adds a column.
    `void` | `addColumn(java.lang.String column, int width)` Adds a column with the given width.
    `void` | `addColumn(java.lang.String column, int width, NdfTable.Alignment alignment)` Adds a column with the given width and alignment.
    `void` | `addColumn(java.lang.String column, NdfTable.Alignment alignment)` Adds a column with the given alignment.
    `void` | `addColumns(java.util.List<java.lang.String> columns)` Adds a list of columns with a default formatting.
    `void` | `addColumns(java.lang.String... columns)` Adds a list of columns with a default formatting.
    `void` | `addRow(java.lang.Object... values)`
    `void` | `addRow(java.lang.String[] values)`
    `java.lang.String` | `format(java.lang.String value)` Returns the next formatted column value.
    `int` | `getColumnCount()`
    `java.lang.String[]` | `getColumnNames()`
    `java.lang.String` | `getTableName()`
    `boolean` | `hasNext()` Tells whether there is a next column available for formatting.
    `java.lang.String` | `nextHeader()` Returns the next formatted column header.
    `void` | `reset()` Reset the current column index.
    `DumpString` | `toDumpString(DumpString s)` This method allows subclasses to add values to the existing DumpString of the superclass.
    `ToString` | `toString(ToString s)` This method allows subclasses to add values to the existing ToString of the superclass.
    `void` | `write(NdfWriter<?> writer)`

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

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

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

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

- - ### Constructor Detail

    - #### NdfTable

          public NdfTable(java.lang.String tableName)

    - #### NdfTable

          public NdfTable(java.lang.String tableName,
                  NdfProperties props)

  - ### Method Detail

    - #### getTableName

          public java.lang.String getTableName()

    - #### getColumnNames

          public java.lang.String[] getColumnNames()

    - #### addColumns

          public void addColumns(java.lang.String... columns)
                          throws java.lang.Exception

      Adds a list of columns with a default formatting.
      Throws:
        `java.lang.Exception`

    - #### addColumns

          public void addColumns(java.util.List<java.lang.String> columns)
                          throws java.lang.Exception

      Adds a list of columns with a default formatting.
      Throws:
        `java.lang.Exception`

    - #### addColumn

          public void addColumn(java.lang.String column,
                       NdfTable.Alignment alignment)
                         throws java.lang.Exception

      Adds a column with the given alignment. The default column width is the width of it's name.
      Throws:
        `java.lang.Exception`

    - #### addColumn

          public void addColumn(java.lang.String column)
                         throws java.lang.Exception

      Adds a column. The default column width is the width of it's name. The default column alignment is LEFT.
      Throws:
        `java.lang.Exception`

    - #### addColumn

          public void addColumn(java.lang.String column,
                       int width)
                         throws java.lang.Exception

      Adds a column with the given width. The default column alignment is LEFT.
      Throws:
        `java.lang.Exception`

    - #### addColumn

          public void addColumn(java.lang.String column,
                       int width,
                       NdfTable.Alignment alignment)
                         throws java.lang.Exception

      Adds a column with the given width and alignment.
      Throws:
        `java.lang.Exception`

    - #### addRow

          public void addRow(java.lang.String[] values)

    - #### addRow

          public void addRow(java.lang.Object... values)

    - #### write

          public void write(NdfWriter<?> writer)
                     throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### getColumnCount

          public int getColumnCount()

    - #### reset

          public void reset()

      Reset the current column index.

    - #### hasNext

          public boolean hasNext()

      Tells whether there is a next column available for formatting.

    - #### nextHeader

          public java.lang.String nextHeader()

      Returns the next formatted column header.

    - #### format

          public java.lang.String format(java.lang.String value)

      Returns the next formatted column value.

    - #### 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`

    - #### toDumpString

          public DumpString toDumpString(DumpString s)

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

Copyright © 2014 EsprIT-Systems. All Rights Reserved.