Class CachedTupleSequence
java.lang.Object
uk.ac.starlink.ttools.plot2.data.CachedTupleSequence
- All Implemented Interfaces:
Tuple, TupleSequence, uk.ac.starlink.util.Sequence, uk.ac.starlink.util.Splittable<TupleSequence>
TupleSequence implementation based on CachedColumns.
- Since:
- 3 Jan 2020
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionCachedTupleSequence(Supplier<CachedReader> maskSupplier, Supplier<CachedReader[]> colsSupplier, long nrow) Public constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetBooleanValue(int icol) Returns the value of a given column as a boolean.doublegetDoubleValue(int icol) Returns the value of a given column as a double.intgetIntValue(int icol) Returns the value of a given column as an integer.longgetLongValue(int icol) Returns the value of a given column as a long.getObjectValue(int icol) Returns the value of a given column as an object.longReturns the row index for the underlying data set.booleannext()Advances to the next entry.split()long
-
Constructor Details
-
CachedTupleSequence
public CachedTupleSequence(Supplier<CachedReader> maskSupplier, Supplier<CachedReader[]> colsSupplier, long nrow) Public constructor.- Parameters:
maskSupplier- supplier for boolean-typed column reader, providing inclusion flags per row; null means include all rowscolsSupplier- supplier for array of columns providing data cells per row
-
-
Method Details
-
next
public boolean next()Description copied from interface:TupleSequenceAdvances to the next entry. No exception is thrown.- Specified by:
nextin interfaceuk.ac.starlink.util.Sequence- Specified by:
nextin interfaceTupleSequence
-
split
- Specified by:
splitin interfaceuk.ac.starlink.util.Splittable<TupleSequence>
-
splittableSize
public long splittableSize()- Specified by:
splittableSizein interfaceuk.ac.starlink.util.Splittable<TupleSequence>
-
getRowIndex
public long getRowIndex()Description copied from interface:TupleReturns the row index for the underlying data set. Note this value may not undergo a simple increment between steps (if rows are excluded from the underlying data set it may increase by more than one in some cases).- Specified by:
getRowIndexin interfaceTuple- Returns:
- row index of underlying table row
-
getObjectValue
Description copied from interface:TupleReturns the value of a given column as an object. If that element of the tuple is not of object type, the result may not be useful.If the result is a mutable object, its value may be overwritten by subsequent calls to this method (especially following calls to
TupleSequence.next()if this object also implementsTupleSequence).- Specified by:
getObjectValuein interfaceTuple- Parameters:
icol- column index- Returns:
- value of element
icol, presumed of object type
-
getDoubleValue
public double getDoubleValue(int icol) Description copied from interface:TupleReturns the value of a given column as a double. If that element of the tuple is not of numeric type, the result may not be useful.- Specified by:
getDoubleValuein interfaceTuple- Parameters:
icol- column index- Returns:
- value of element
icol, presumed of numeric type
-
getIntValue
public int getIntValue(int icol) Description copied from interface:TupleReturns the value of a given column as an integer. If that element of the tuple is not of numeric type, the result may not be useful.- Specified by:
getIntValuein interfaceTuple- Parameters:
icol- column index- Returns:
- value of element
icol, presumed of numeric type
-
getLongValue
public long getLongValue(int icol) Description copied from interface:TupleReturns the value of a given column as a long. If that element of the tuple is not of numeric type, the result may not be useful.- Specified by:
getLongValuein interfaceTuple- Parameters:
icol- column index- Returns:
- value of element
icol, presumed of numeric type
-
getBooleanValue
public boolean getBooleanValue(int icol) Description copied from interface:TupleReturns the value of a given column as a boolean. If that element of the table is not of boolean type, the result may not be useful.- Specified by:
getBooleanValuein interfaceTuple- Parameters:
icol- column index- Returns:
- value of element
icol, presumed of boolean type
-