Package com.luciad.format.csv
Class TLcdCSVDataSource
java.lang.Object
com.luciad.format.csv.TLcdCSVDataSource
- All Implemented Interfaces:
ILcdDataSource
An
ILcdDataSource describing the structure of a character separated data file, which can be passed to the
TLcdCSVModelDecoder to decode the data.
New instances can be created through a TLcdCSVDataSource.Builder (see newBuilder()).- Since:
- 2018.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder class for aTLcdCSVDataSourceinstance.static enumThe different column types which can be defined in a.csvtfile. -
Method Summary
Modifier and TypeMethodDescriptionReturns a newBuilderinstance initialised with the values of this data source.booleanReturns a string description of the data source.Returns the encoding of the data fileintReturns the index of the GeoJson encoded geometry, or -1 when no such column exists.intReturns the index of the column specifying the unique ID of each element, or -1 when no such column exists.intReturns the number of rows to skip from the data file.Returns the separator used in the data fileReturns the source name of the data file.getTypes()Return the types of the different columns, ornullwhen the types are not specified.intReturns the index of the WKT encoded geometry, or -1 when no such column exists.intReturns the index of the X coordinate column, or -1 when no such column exists.intReturns the index of the Y coordinate column, or -1 when no such column exists.intReturns the index of the Z coordinate column, or -1 when no such column exists.inthashCode()booleanReturnstruewhen the first row of the data file contains the names of each column.static TLcdCSVDataSource.BuilderCreates a newBuilderinstance initialized with default values.toString()
-
Method Details
-
getSource
Returns the source name of the data file.- Returns:
- the source name of the data file, never
null
-
getEncoding
Returns the encoding of the data file- Returns:
- the encoding of the data file, never
null
-
getSeparator
Returns the separator used in the data file- Returns:
- the separator used in the data file, never
null
-
isFirstRowContainsNames
public boolean isFirstRowContainsNames()Returnstruewhen the first row of the data file contains the names of each column. The first row is considered to be the first row in the data file after skipping the firstgetRowsToSkip()number of rows.- Returns:
truewhen the first row of the data file contains the names of each column,falseotherwise.
-
getRowsToSkip
public int getRowsToSkip()Returns the number of rows to skip from the data file. This allows to for example ignore a header in the file.- Returns:
- the number of rows to skip from the data file.
-
getColumnNames
- Returns:
- the column names, or
nullwhenisFirstRowContainsNames()returnstrue
-
getIDColumn
public int getIDColumn()Returns the index of the column specifying the unique ID of each element, or -1 when no such column exists.- Returns:
- the index of the column specifying the unique ID of each element, or -1 when no such column exists.
-
getTypes
Return the types of the different columns, ornullwhen the types are not specified.- Returns:
- The types of the different columns, or
nullwhen the types are not specified.
-
getWKTGeometryColumn
public int getWKTGeometryColumn()Returns the index of the WKT encoded geometry, or -1 when no such column exists.- Returns:
- the index of the WKT encoded geometry, or -1 when no such column exists.
-
getGeoJsonGeometryColumn
public int getGeoJsonGeometryColumn()Returns the index of the GeoJson encoded geometry, or -1 when no such column exists.- Returns:
- the index of the GeoJson encoded geometry, or -1 when no such column exists.
- Since:
- 2019.1
-
getXPointColumn
public int getXPointColumn()Returns the index of the X coordinate column, or -1 when no such column exists.- Returns:
- the index of the X coordinate column, or -1 when no such column exists.
-
getYPointColumn
public int getYPointColumn()Returns the index of the Y coordinate column, or -1 when no such column exists.- Returns:
- the index of the Y coordinate column, or -1 when no such column exists.
-
getZPointColumn
public int getZPointColumn()Returns the index of the Z coordinate column, or -1 when no such column exists.- Returns:
- the index of the Z coordinate column, or -1 when no such column exists.
-
getDescription
Description copied from interface:ILcdDataSourceReturns a string description of the data source. This will typically be used in a GUI, or in error and warning messages.- Specified by:
getDescriptionin interfaceILcdDataSource- Returns:
- a String describing the data source.
-
asBuilder
Returns a newBuilderinstance initialised with the values of this data source.- Returns:
- a new
Builderinstance initialised with the values of this data source.
-
equals
-
hashCode
public int hashCode() -
toString
-
newBuilder
Creates a newBuilderinstance initialized with default values.- Returns:
- a new
Builderinstance initialized with default values
-