Package com.logicaldoc.ai.sampler
Class CSVSampler
java.lang.Object
com.logicaldoc.core.PersistentObject
com.logicaldoc.ai.sampler.Sampler
com.logicaldoc.ai.sampler.StreamSampler
com.logicaldoc.ai.sampler.CSVSampler
- All Implemented Interfaces:
Closeable
,Serializable
,AutoCloseable
A
Expected format of each resource is this one:
StreamSampler
that reads the contents of a CSV file extracting all
the rows as string arrays. Expected format of each resource is this one:
5.1,3.5,1.4,.2,"Setosa" 7,3.2,4.7,1.4,"Versicolor" 6.2,3.4,5.4,2.3,"Virginica"This example will produce three rows of 5 elements each:
5.1, 3.5, 1.4, .2, Setosa 7, 3.2, 4.7, 1.4, Versicolor 6.2, 3.4, 5.4, 2.3, Virginica
- Since:
- 9.2
- Author:
- Marco Meschieri - LogicalDOC
- See Also:
-
Field Summary
Fields inherited from class com.logicaldoc.core.PersistentObject
DELETED_CODE_DEFAULT, DELETED_CODE_STRONG, id
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncollect()
Collects a list of samplesboolean
int
getQuote()
int
hashCode()
void
setCategoryIndex
(int categoryIndex) void
setDelimiter
(String delimiter) void
Methods inherited from class com.logicaldoc.ai.sampler.StreamSampler
close, getStream, setStream
Methods inherited from class com.logicaldoc.ai.sampler.Sampler
getDescription, getDocId, getFolderId, getLabel, getName, newSampler, setDescription, setDocId, setFolderId, setLabel, setName, toString, types
Methods inherited from class com.logicaldoc.core.PersistentObject
getCreation, getDeleted, getId, getLastModified, getRecordVersion, getTenantId, setCreation, setDeleted, setId, setLastModified, setRecordVersion, setTenantId
-
Constructor Details
-
CSVSampler
public CSVSampler() -
CSVSampler
-
CSVSampler
-
-
Method Details
-
getDelimiter
-
setDelimiter
-
getQuote
-
setQuote
-
getCategoryIndex
public int getCategoryIndex() -
setCategoryIndex
public void setCategoryIndex(int categoryIndex) -
collect
Description copied from class:Sampler
Collects a list of samples- Specified by:
collect
in classSampler
- Returns:
- The iterator over the samples
- Throws:
IOException
- I/O Error
-
hashCode
public int hashCode() -
equals
-