Class ColumnData
java.lang.Object
net.simplace.core.io.ColumnData
Definition of one column of a data reader: the character range in a fixed-width line (1-based
startCol..endCol) or a constant value, name and data type. A head element
defines the row head column.- Author:
- Andreas Enders
-
Constructor Summary
ConstructorsModifierConstructorDescriptionColumnData(int aStartCol, int aEndCol, String aColName, String aValue, String aDataType, boolean aIsHeadColumn, int aColumnIndex) protectedColumnData(org.jdom2.Element aDataElement, int aColumnIndex, FWObservable aObservable) Creates the column from its configuration element (attributesstartCol,endCol,value,colName,dataType). -
Method Summary
Modifier and TypeMethodDescriptionbooleanColumns are equal if their names are equal.intReturns the value of the column for a line: the characters of the column range, or the constant value (with${ROWCOUNT}replaced by the row index).inthashCode()voidinitColName(String aLine, int aI) Sets the column name from the header line, unless a name is configured; empty names becomeROW_HEADorCategorie n.booleanbooleanprotected voidsetColName(String aColName) protected voidsetColumnIndex(int aColumnIndex) voidtoString()
-
Constructor Details
-
ColumnData
Creates the column from its configuration element (attributesstartCol,endCol,value,colName,dataType).- Parameters:
aDataElement- the configuration element (headfor the row head column)aColumnIndex- index of the column (1-based)aObservable- provides the parameters for the attribute values
-
ColumnData
public ColumnData(int aStartCol, int aEndCol, String aColName, String aValue, String aDataType, boolean aIsHeadColumn, int aColumnIndex) - Parameters:
aStartCol- first character (1-based)aEndCol- last character (1-based, inclusive)aColName- column nameaValue- constant value, ornullto read from the lineaDataType- data type (SQL type name)aIsHeadColumn- if this is the row head columnaColumnIndex- index of the column (1-based)
-
-
Method Details
-
getColName
- Returns:
- the column name
-
getDataType
- Returns:
- the data type;
VARCHAR(255)for character data
-
getEndCol
- Returns:
- the last character (1-based, inclusive), or
nullwithout range
-
getStartCol
- Returns:
- the first character (1-based), or
nullwithout range
-
getColumnIndex
public int getColumnIndex()- Returns:
- the index of the column (1-based)
-
initColName
Sets the column name from the header line, unless a name is configured; empty names becomeROW_HEADorCategorie n.- Parameters:
aLine- the header lineaI- not used
-
setColumnIndex
protected void setColumnIndex(int aColumnIndex) - Parameters:
aColumnIndex- the index of the column (1-based)
-
isHeadColumn
public boolean isHeadColumn()- Returns:
trueif this is the row head column
-
isCharType
public boolean isCharType()- Returns:
truefor character data (no type,CHAR...orVARCHAR...)
-
setColName
- Parameters:
aColName- the column name
-
getValue
-
setValue
- Parameters:
aValue- the constant value, ornullto read from the line
-
equals
-
hashCode
-
toString
-