use of org.teiid.query.sql.lang.TextTable.TextColumn in project teiid by teiid.
the class TextTableNode method parseFixedWidth.
private List<String> parseFixedWidth(StringBuilder line) {
ArrayList<String> result = new ArrayList<String>();
int beginIndex = 0;
for (TextColumn col : table.getColumns()) {
if (beginIndex >= line.length()) {
result.add(null);
} else {
String val = new String(line.substring(beginIndex, Math.min(line.length(), beginIndex + col.getWidth())));
addValue(result, col.isNoTrim(), val);
beginIndex += col.getWidth();
}
}
return result;
}
Aggregations