public class FixedWidthTextSequencer extends AbstractTextSequencer
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
Sequencer.Context
Constructor and Description |
---|
FixedWidthTextSequencer() |
Modifier and Type | Method and Description |
---|---|
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.
|
execute, getCommentMarker, getMaximumLinesToRead, getRowFactoryClassName, initialize, setCommentMarker, setMaximumLinesToRead, setRowFactoryClassName
getAcceptedMimeTypes, getLogger, getName, getPathExpressions, getRepositoryName, getUniqueId, hasAcceptedMimeTypes, isAccepted, registerDefaultMimeTypes, registerNamespace, registerNodeTypes, registerNodeTypes, toString
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 parsedCopyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.