Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.modeshape.sequencer.text
Class FixedWidthTextSequencer

    java.lang.Object
      org.modeshape.sequencer.text.AbstractTextSequencer
          org.modeshape.sequencer.text.FixedWidthTextSequencer

All Implemented Interfaces:
  StreamSequencer

    public class FixedWidthTextSequencer

extends AbstractTextSequencer

An text sequencer implementation that uses a `list of column numbers` to split incoming rows into fixed-width columns. By default, this class treats each row as a single column. There is an implicit column start index of 0 for the first column.

See Also:
  `AbstractTextSequencer`

Constructor Summary
`FixedWidthTextSequencer()`

Method Summary
`protected String[]` | `parseLine(String line)` Parse the given row into its constituent columns.
`void` | `setColumnStartPositions(int[] columnStartPositions)` Set the column start positions.
`void` | `setColumnStartPositions(String commaDelimitedColumnStartPositions)` Set the column start positions from a list of column start positions concatenated into a single, comma-delimited string.

Methods inherited from class org.modeshape.sequencer.text.AbstractTextSequencer
`createRowFactory, getCommentMarker, getMaximumLinesToRead, getRowFactoryClassName, sequence, setCommentMarker, setMaximumLinesToRead, setRowFactoryClassName`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### FixedWidthTextSequencer

    public FixedWidthTextSequencer()

Method Detail

### setColumnStartPositions

    public void setColumnStartPositions(int[] columnStartPositions)

  Set the column start positions. The column start positions are 0-based. Everything before the first start position is treated as the first column.

  As an example, if the column start positions were {3, 6, 15} and the incoming stream was:

                 1         2
       012345678901234567890
       supercallifragilistic
       expialidocious

  This sequencer would return the following rows:

       row 1: "sup", "erc", "allifragi", "listic"
       row 2: "exp:, "ial", "idocious"

  Note that there are only three columns returned in the second row, as there were not enough characters to reach the third start position.

  Parameters:
    `columnStartPositions` - the column startPositions; may not be null

### setColumnStartPositions

    public void setColumnStartPositions(String commaDelimitedColumnStartPositions)

  Set the column start positions from a list of column start positions concatenated into a single, comma-delimited string.

  Parameters:
    `commaDelimitedColumnStartPositions` - a list of column start positions concatenated into a single, comma-delimited string; may not be null
  See Also:
    `setColumnStartPositions(int[])`

### parseLine

    protected String[] parseLine(String line)

  Description copied from class: `AbstractTextSequencer`
  Parse the given row into its constituent columns.

  Specified by:
    `parseLine` in class `AbstractTextSequencer`
  Parameters:
    `line` - the row to be parsed
  Returns:
    an array of columns; never null

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008-2011 JBoss, a division of Red Hat. All Rights Reserved.