Package adams.data.io.input
Class AbstractTextReader<T>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.input.AbstractTextReader<T>
-
- Type Parameters:
T
- the type of data to return
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,Serializable
- Direct Known Subclasses:
AbstractCompressedTextReader
,AbstractTextReaderWithEncoding
public abstract class AbstractTextReader<T> extends AbstractOptionHandler implements QuickInfoSupporter
Ancestor for readers for text streams.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected InputStream
m_Stream
the stream in use.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractTextReader()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract T
doNext()
Returns the next lot of data.abstract Class
generates()
Returns the class of the data that it returns.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.boolean
hasNext()
Returns whether more data is available.void
initialize(InputStream stream)
Initializes the input stream to read the content from.T
next()
Returns the next lot of data.void
reset()
Resets the reader.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Stream
protected InputStream m_Stream
the stream in use.
-
-
Method Detail
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.
Default implementation returns null.- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Returns:
- null if no info available, otherwise short string
-
generates
public abstract Class generates()
Returns the class of the data that it returns.- Returns:
- the generated data type
-
initialize
public void initialize(InputStream stream)
Initializes the input stream to read the content from.- Parameters:
stream
- the input stream to use
-
reset
public void reset()
Resets the reader.- Overrides:
reset
in classAbstractOptionHandler
-
hasNext
public boolean hasNext()
Returns whether more data is available.- Returns:
- true if more data is available
-
doNext
protected abstract T doNext()
Returns the next lot of data.- Returns:
- the next amount of data, null if failed to read
-
next
public T next()
Returns the next lot of data.- Returns:
- the next amount of data, null if failed to read
-
-