Package jisa.results
Class ResultStream
- java.lang.Object
-
- jisa.results.ResultTable
-
- jisa.results.ResultStream
-
- All Implemented Interfaces:
java.lang.Iterable<Row>
public class ResultStream extends ResultTable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jisa.results.ResultTable
ResultTable.ClearListener, ResultTable.Rowable, ResultTable.RowBuilder, ResultTable.RowListener, ResultTable.RowSetter
-
-
Field Summary
-
Fields inherited from class jisa.results.ResultTable
STANDARD_TYPES
-
-
Constructor Summary
Constructors Constructor Description ResultStream(java.lang.String file, java.lang.String... columns)
ResultStream(java.lang.String file, Column<?>... columns)
ResultStream(Column<?>... columns)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addBefore(int lineNo, java.lang.String newLine)
protected void
addRowData(Row row)
Implementation method for storing a given Row of data.protected void
clearData()
Implementation method for clearing all data from the table.void
close()
protected java.lang.String
getLine()
protected java.lang.String
getLine(int no)
Row
getRow(int index)
Returns the row with the given index as a Row object.int
getRowCount()
Returns the number of rows in the table.java.util.Iterator<Row>
iterator()
static ResultStream
loadFile(java.lang.String path)
protected void
replaceLine(int lineNo, java.lang.String newLine)
protected void
resetPosition()
void
setAttribute(java.lang.String key, java.lang.String value)
Stores the given value in this table's header, using the specified key to identify it.protected void
setAttributeQuiet(java.lang.String key, java.lang.String value)
java.util.stream.Stream<Row>
stream()
Returns a sequential Stream of Row objects with this table as its source-
Methods inherited from class jisa.results.ResultTable
addClearListener, addData, addRow, addRow, addRowListener, allMatch, clear, collector, directionalSplit, directionalSplit, filter, findColumn, findColumn, findColumn, findColumn, findRow, get, getAttribute, getAttributeLine, getAttributes, getColumn, getColumnCount, getColumnHeaderLine, getColumns, getColumnsAsArray, getCSVLine, getFirstNumericColumn, getHTML, getNthNumericColumn, getNumericColumns, getRows, getUniqueValues, getUniqueValues, mapRow, mapRow, mapRow, mapRows, mapRows, max, max, maxBy, maxBy, mean, mean, min, min, minBy, minBy, noneMatch, output, output, output, outputHTML, outputHTML, outputHTML, outputTable, outputTable, outputTable, outputTable, parseColumnHeaderLine, parseCSVLine, removeClearListener, removeRowListener, reverse, setAttribute, size, sorted, sorted, split, split, startRow, subTable, subTable, subTable, toList, toList, toMatrix, toMatrix, transform
-
-
-
-
Constructor Detail
-
ResultStream
public ResultStream(Column<?>... columns) throws java.io.IOException
- Throws:
java.io.IOException
-
ResultStream
public ResultStream(java.lang.String file, Column<?>... columns) throws java.io.IOException
- Throws:
java.io.IOException
-
ResultStream
public ResultStream(java.lang.String file, java.lang.String... columns) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
loadFile
public static ResultStream loadFile(java.lang.String path) throws java.io.IOException
- Throws:
java.io.IOException
-
setAttribute
public void setAttribute(java.lang.String key, java.lang.String value)
Description copied from class:ResultTable
Stores the given value in this table's header, using the specified key to identify it.- Overrides:
setAttribute
in classResultTable
- Parameters:
key
- Key (unique identifier of attribute)value
- Attribute value
-
setAttributeQuiet
protected void setAttributeQuiet(java.lang.String key, java.lang.String value)
-
getRow
public Row getRow(int index)
Description copied from class:ResultTable
Returns the row with the given index as a Row object.- Specified by:
getRow
in classResultTable
- Parameters:
index
- Row index- Returns:
- Row object for given index
-
addRowData
protected void addRowData(Row row)
Description copied from class:ResultTable
Implementation method for storing a given Row of data.- Specified by:
addRowData
in classResultTable
- Parameters:
row
- Row to store
-
getRowCount
public int getRowCount()
Description copied from class:ResultTable
Returns the number of rows in the table.- Specified by:
getRowCount
in classResultTable
- Returns:
- Number of rows
-
clearData
protected void clearData()
Description copied from class:ResultTable
Implementation method for clearing all data from the table.- Specified by:
clearData
in classResultTable
-
stream
public java.util.stream.Stream<Row> stream()
Description copied from class:ResultTable
Returns a sequential Stream of Row objects with this table as its source- Specified by:
stream
in classResultTable
- Returns:
- Stream of rows
-
iterator
public java.util.Iterator<Row> iterator()
-
getLine
protected java.lang.String getLine() throws java.io.IOException
- Throws:
java.io.IOException
-
getLine
protected java.lang.String getLine(int no) throws java.io.IOException
- Throws:
java.io.IOException
-
resetPosition
protected void resetPosition() throws java.io.IOException
- Throws:
java.io.IOException
-
replaceLine
protected void replaceLine(int lineNo, java.lang.String newLine)
-
addBefore
protected void addBefore(int lineNo, java.lang.String newLine)
-
close
public void close()
-
-