Package uk.ac.starlink.ttools.plot2.data
Class EmptyTupleSequence
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.data.EmptyTupleSequence
-
- All Implemented Interfaces:
Tuple
,TupleSequence
public class EmptyTupleSequence extends java.lang.Object implements TupleSequence
TupleSequence implementation with no data. Thenext
method always returns false.- Since:
- 19 Dec 2018
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description EmptyTupleSequence()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getBooleanValue(int ic)
Returns the value of a given column as a boolean.double
getDoubleValue(int ic)
Returns the value of a given column as a double.int
getIntValue(int ic)
Returns the value of a given column as an integer.long
getLongValue(int ic)
Returns the value of a given column as a long.java.lang.Object
getObjectValue(int ic)
Returns the value of a given column as an object.long
getRowIndex()
Returns the row index for the underlying data set.boolean
next()
Move to the next item in the sequence.
-
-
-
Method Detail
-
next
public boolean next()
Description copied from interface:TupleSequence
Move to the next item in the sequence. Must be called before accessing each row, including the first one. Returns false when there are no rows left.- Specified by:
next
in interfaceTupleSequence
- Returns:
- true iff the item moved to has data
-
getBooleanValue
public boolean getBooleanValue(int ic)
Description copied from interface:Tuple
Returns 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:
getBooleanValue
in interfaceTuple
- Parameters:
ic
- column index- Returns:
- value of element
icol
, presumed of boolean type
-
getIntValue
public int getIntValue(int ic)
Description copied from interface:Tuple
Returns 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:
getIntValue
in interfaceTuple
- Parameters:
ic
- column index- Returns:
- value of element
icol
, presumed of numeric type
-
getLongValue
public long getLongValue(int ic)
Description copied from interface:Tuple
Returns 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:
getLongValue
in interfaceTuple
- Parameters:
ic
- column index- Returns:
- value of element
icol
, presumed of numeric type
-
getDoubleValue
public double getDoubleValue(int ic)
Description copied from interface:Tuple
Returns 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:
getDoubleValue
in interfaceTuple
- Parameters:
ic
- column index- Returns:
- value of element
icol
, presumed of numeric type
-
getObjectValue
public java.lang.Object getObjectValue(int ic)
Description copied from interface:Tuple
Returns 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:
getObjectValue
in interfaceTuple
- Parameters:
ic
- column index- Returns:
- value of element
icol
, presumed of object type
-
getRowIndex
public long getRowIndex()
Description copied from interface:Tuple
Returns 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:
getRowIndex
in interfaceTuple
- Returns:
- row index of underlying table row
-
-