Class CollectingStatusListener
java.lang.Object
de.siegmar.fastcsv.reader.CollectingStatusListener
- All Implemented Interfaces:
StatusListener
Implementation of
StatusListener that collects updates.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongGet the number of bytes already read.longGet the total size in bytes.longGet the number of records already indexed.Get the throwable that occurred while indexing.booleanGet the completion status.voidCalled when the indexing finished successfully (without an exception).voidCalled when there was an error while indexing.voidonInit(long fileSize) Called on initialization.voidonReadBytes(int bytes) Called when a new read operation has been performend.voidCalled when a new record has been read.toString()
-
Constructor Details
-
CollectingStatusListener
public CollectingStatusListener()Default constructor.
-
-
Method Details
-
onInit
public void onInit(long fileSize) Description copied from interface:StatusListenerCalled on initialization.- Specified by:
onInitin interfaceStatusListener- Parameters:
fileSize- the total file size.
-
getFileSize
public long getFileSize()Get the total size in bytes.- Returns:
- the total size in bytes
-
onReadRecord
public void onReadRecord()Description copied from interface:StatusListenerCalled when a new record has been read.- Specified by:
onReadRecordin interfaceStatusListener
-
getRecordCount
public long getRecordCount()Get the number of records already indexed.- Returns:
- the number of records already indexed
-
onReadBytes
public void onReadBytes(int bytes) Description copied from interface:StatusListenerCalled when a new read operation has been performend.- Specified by:
onReadBytesin interfaceStatusListener- Parameters:
bytes- number of bytes read.
-
getByteCount
public long getByteCount()Get the number of bytes already read.- Returns:
- the number of bytes already read
-
onComplete
public void onComplete()Description copied from interface:StatusListenerCalled when the indexing finished successfully (without an exception).- Specified by:
onCompletein interfaceStatusListener
-
isCompleted
public boolean isCompleted()Get the completion status.- Returns:
true, when all data have been indexed successfully
-
onError
Description copied from interface:StatusListenerCalled when there was an error while indexing.- Specified by:
onErrorin interfaceStatusListener- Parameters:
throwable- the exception thrown.
-
getThrowable
-
toString
-