Package com.redwood.agent.api.rtx
Class RTXReader
- java.lang.Object
-
- com.redwood.agent.api.rtx.RTXReader
-
- All Implemented Interfaces:
RTXProducer,Closeable,AutoCloseable,Iterable<RTXRow>
public class RTXReader extends Object implements RTXProducer
Reader for RTX format.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRTXReader.StrictModeControl over how strictly the specification is interpreted.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()RTXMetadatagetMetadata()intgetRowNumber()RTXReader.StrictModegetStrictMode()booleanhasNext()Iterator<RTXRow>iterator()Iterator<RTXRow>iterator(String... cols)Return an iterator with a subset of columns.RTXRownext()Iterable<RTXRow>rows()Return anIterablefor rows from the current position on, this can only be used to retrieve a single iterator.Iterable<RTXRow>rows(String... cols)voidsetStrictMode(RTXReader.StrictMode newStrictMode)Sets theRTXReader.StrictMode, that is, when this RTXProducer does support strictMode.booleansupportsStrictMode(RTXReader.StrictMode newStrictMode)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
RTXReader
public RTXReader(InputStream newInputStream) throws RTXReaderException, RTXMetadataRuntimeException
-
RTXReader
public RTXReader(Reader newInputReader) throws RTXReaderException, RTXMetadataRuntimeException
-
RTXReader
public RTXReader(String filename) throws FileNotFoundException, RTXReaderException, RTXMetadataRuntimeException
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceRTXProducer
-
getMetadata
public RTXMetadata getMetadata()
- Specified by:
getMetadatain interfaceRTXProducer- Returns:
- the metadata of the data, describing the column definitions and sources.
-
hasNext
public boolean hasNext() throws RTXReaderException- Specified by:
hasNextin interfaceRTXProducer- Returns:
- true, when there is a next row, false otherwise
- Throws:
RTXReaderException
-
next
public RTXRow next() throws RTXReaderException, RTXMetadataRuntimeException, RTXColumnRuntimeException
- Specified by:
nextin interfaceRTXProducer- Returns:
- the next row.
- Throws:
RTXReaderExceptionRTXMetadataRuntimeExceptionRTXColumnRuntimeException
-
getRowNumber
public int getRowNumber()
- Specified by:
getRowNumberin interfaceRTXProducer- Returns:
- the row-number of the current row. It starts with
0 and is increased by
RTXProducer.hasNext(). The first row will have the row-number 1.
-
getStrictMode
public RTXReader.StrictMode getStrictMode()
- Specified by:
getStrictModein interfaceRTXProducer
-
setStrictMode
public void setStrictMode(RTXReader.StrictMode newStrictMode)
Description copied from interface:RTXProducerSets theRTXReader.StrictMode, that is, when this RTXProducer does support strictMode.- Specified by:
setStrictModein interfaceRTXProducer- Parameters:
newStrictMode- the new mode
-
supportsStrictMode
public boolean supportsStrictMode(RTXReader.StrictMode newStrictMode)
- Specified by:
supportsStrictModein interfaceRTXProducer
-
iterator
public Iterator<RTXRow> iterator()
- Specified by:
iteratorin interfaceIterable<RTXRow>- Specified by:
iteratorin interfaceRTXProducer
-
rows
public Iterable<RTXRow> rows(String... cols)
Description copied from interface:RTXProducerReturn anIterablefor rows from the current position on, with a subset of columns, this can only be used to retrieve a single iterator.- Specified by:
rowsin interfaceRTXProducer- Parameters:
cols- a list of columns- Returns:
- an
Iterablewith a subset of columns.
-
rows
public Iterable<RTXRow> rows()
Description copied from interface:RTXProducerReturn anIterablefor rows from the current position on, this can only be used to retrieve a single iterator.- Specified by:
rowsin interfaceRTXProducer- Returns:
- an
Iterable.
-
iterator
public Iterator<RTXRow> iterator(String... cols)
Description copied from interface:RTXProducerReturn an iterator with a subset of columns.- Specified by:
iteratorin interfaceRTXProducer- Parameters:
cols- a list of columns- Returns:
- an iterator with a subset of columns.
-
-