|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.sequencer.text.AbstractTextSequencer
org.modeshape.sequencer.text.FixedWidthTextSequencer
public class FixedWidthTextSequencer
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.
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 |
---|
public FixedWidthTextSequencer()
Method Detail |
---|
public void setColumnStartPositions(int[] columnStartPositions)
As an example, if the column start positions were {3, 6, 15} and the incoming stream was:
1 2 012345678901234567890 supercallifragilistic expialidociousThis 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.
columnStartPositions
- the column startPositions; may not be nullpublic void setColumnStartPositions(String commaDelimitedColumnStartPositions)
commaDelimitedColumnStartPositions
- a list of column start positions concatenated into a single, comma-delimited
string; may not be nullsetColumnStartPositions(int[])
protected String[] parseLine(String line)
AbstractTextSequencer
parseLine
in class AbstractTextSequencer
line
- the row to be parsed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |