Package com.emc.mongoose.base.item.io
Class CsvItemInput<I extends Item>
- java.lang.Object
-
- com.emc.mongoose.base.item.io.CsvItemInput<I>
-
- All Implemented Interfaces:
com.github.akurilov.commons.io.Input<I>,java.lang.AutoCloseable,java.util.function.Supplier<I>
- Direct Known Subclasses:
CsvFileItemInput
public class CsvItemInput<I extends Item> extends java.lang.Object implements com.github.akurilov.commons.io.Input<I>The data item input using CSV file containing the human-readable data item records as the source
-
-
Field Summary
Fields Modifier and Type Field Description protected ItemFactory<I>itemFactoryprotected java.io.BufferedReaderitemsSrc
-
Constructor Summary
Constructors Modifier Constructor Description protectedCsvItemInput(java.io.BufferedReader itemsSrc, ItemFactory<I> itemFactory)CsvItemInput(java.io.InputStream in, ItemFactory<I> itemFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Iget()intget(java.util.List<I> buffer, int limit)voidreset()Most probably will cause an IOException due to missing markprotected voidsetItemsSrc(java.io.BufferedReader itemsSrc)longskip(long itemsCount)java.lang.StringtoString()
-
-
-
Field Detail
-
itemsSrc
protected java.io.BufferedReader itemsSrc
-
itemFactory
protected final ItemFactory<I extends Item> itemFactory
-
-
Constructor Detail
-
CsvItemInput
public CsvItemInput(java.io.InputStream in, ItemFactory<I> itemFactory)- Parameters:
in- the input stream to get the data item records fromitemFactory- the concrete item factory used to parse the records- Throws:
java.io.IOExceptionjava.lang.NoSuchMethodException
-
CsvItemInput
protected CsvItemInput(java.io.BufferedReader itemsSrc, ItemFactory<I> itemFactory)
-
-
Method Detail
-
setItemsSrc
protected final void setItemsSrc(java.io.BufferedReader itemsSrc)
-
skip
public long skip(long itemsCount)
-
get
public I get()
-
get
public int get(java.util.List<I> buffer, int limit)
-
reset
public void reset()
Most probably will cause an IOException due to missing mark
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-