Package net.simplace.sim.io.interfaces
Class CSVInterface
java.lang.Object
net.simplace.sim.io.interfaces.FWSimInterface<FilePool>
net.simplace.sim.io.interfaces.FILEInterface
net.simplace.sim.io.interfaces.CSVInterface
implementation of the
giving access to resources from and output to files
divider can be given in xml-configuration tag. If not given divider will by default be 'tab' or '\t'
Use Interface by
FWSimInterface
FWSimInterface.getInterface(FWSimVarMap, CONTENT_TYPE)
.getLinesOfFile();- Author:
- Andreas Enders
-
Nested Class Summary
Nested classes/interfaces inherited from class net.simplace.sim.io.interfaces.FWSimInterface
FWSimInterface.INTERFACE_TYPE
-
Field Summary
Modifier and TypeFieldDescriptionprotected CSVInterface.DATA_MODE
data mode for IO to read/write array valuesprotected String
divider can be given in xml-configuration tag.protected Integer[]
number of header lines to skip before reading the dataprotected long
the file nameprotected Integer
number of header lines to skip before reading the dataprotected boolean
add unit to field name in outputFields inherited from class net.simplace.sim.io.interfaces.FILEInterface
iContent, iFileinfo, iFilename
Fields inherited from class net.simplace.sim.io.interfaces.FWSimInterface
iColumnMap, iColumnNamesInt, iIntColumnNames
-
Constructor Summary
ModifierConstructorDescriptionCSVInterface
(String aName, int aPoolSize, String aFileName, String aContent, String aDivider, long aSkipAboveSize, Integer[] aLinesToRead, Integer aSkipHeaderLines, Boolean aAddUnit2FieldName, CSVInterface.DATA_MODE aDataMode) protected
CSVInterface
(String aName, org.jdom2.Element aInterfaceElement) -
Method Summary
Modifier and TypeMethodDescriptionboolean
divider can be given in xml-configuration tag.getInterface
(FWSimVarMap aVarMap, FWSimVariable.CONTENT_TYPE aContentType) implementation of the get interface method.Integer[]
long
read
(FWSimSession aFwSimSession, String aProjectID, Object aCache, LinkedHashMap<String, String> aKeyMap, FWSimInputAdapter aResourceAdapter, String aUniqueID, FWSimInterface.INTERFACE_TYPE aInterfaceType) factory method creating an interface instance concerning the given data typeorg.jdom2.Element
toXML()
Methods inherited from class net.simplace.sim.io.interfaces.FILEInterface
finalize, getFilename, setFilename
Methods inherited from class net.simplace.sim.io.interfaces.FWSimInterface
checkHeaderForColMode, createInterface, createInterface, createStatisticInterface, getInterfaceType, getName, getPoolSize, readColArray, toString, transformArrays, writeToDatabase
-
Field Details
-
iDivider
divider can be given in xml-configuration tag. If not given divider will by default be 'tab' or '\t' -
iSkipAboveSize
protected long iSkipAboveSizethe file name -
iLinesToRead
number of header lines to skip before reading the data -
iUnit2Fieldname
protected boolean iUnit2Fieldnameadd unit to field name in output -
iDataMode
data mode for IO to read/write array values -
iSkipHeaderLines
number of header lines to skip before reading the data
-
-
Constructor Details
-
CSVInterface
- Parameters:
aName
-aPoolSize
-aInterfaceElement
-
-
CSVInterface
public CSVInterface(String aName, int aPoolSize, String aFileName, String aContent, String aDivider, long aSkipAboveSize, Integer[] aLinesToRead, Integer aSkipHeaderLines, Boolean aAddUnit2FieldName, CSVInterface.DATA_MODE aDataMode) - Parameters:
aName
-aPoolSize
-aFileName
-aDivider
-aSkipAboveSize
-aLinesToRead
-aSkipHeaderLines
-
-
-
Method Details
-
read
public FWSimResourceCache read(FWSimSession aFwSimSession, String aProjectID, Object aCache, LinkedHashMap<String, String> aKeyMap, FWSimInputAdapter aResourceAdapter, String aUniqueID, FWSimInterface.INTERFACE_TYPE aInterfaceType) throws MissingSimResourceExceptionDescription copied from class:FWSimInterface
factory method creating an interface instance concerning the given data type- Specified by:
read
in classFWSimInterface<FilePool>
- Returns:
- generic
FWSimResourceCache
- Throws:
MissingSimResourceException
-
getInterface
implementation of the get interface method.- Overrides:
getInterface
in classFILEInterface
- Returns:
- generic interface connection object. for example: database - connection; xml - fileinfo
- See Also:
-
getDivider
divider can be given in xml-configuration tag. If not given divider will by default be 'tab' or '\t'- Returns:
- the divider the string is split with to read the data from columns
-
getLinesToRead
- Returns:
-
getSkipHeaderLines
- Returns:
- the skipHeaderLines
-
getSkipAboveSize
public long getSkipAboveSize()- Returns:
-
getDataMode
-
getAddUnitToFieldName
public boolean getAddUnitToFieldName()- Returns:
- if units should be added to field name
-
toXML
public org.jdom2.Element toXML()- Overrides:
toXML
in classFILEInterface
- Returns:
- Element containing configuration for this Interface
-