uk.ac.starlink.ttools.plot2.data
Class WrapperTupleSequence

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.data.WrapperTupleSequence
All Implemented Interfaces:
TupleSequence

public class WrapperTupleSequence
extends Object
implements TupleSequence

TupleSequence implementation that delegates all methods to a base instance.

Since:
18 Nov 2013
Author:
Mark Taylor

Constructor Summary
WrapperTupleSequence(TupleSequence base)
          Constructor.
 
Method Summary
 boolean getBooleanValue(int icol)
          Returns the value of a given column as a boolean.
 double getDoubleValue(int icol)
          Returns the value of a given column as a double.
 Object getObjectValue(int icol)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WrapperTupleSequence

public WrapperTupleSequence(TupleSequence base)
Constructor.

Parameters:
base - sequence to which all methods are delegated
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 interface TupleSequence
Returns:
true iff the item moved to has data

getRowIndex

public long getRowIndex()
Description copied from interface: TupleSequence
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 interface TupleSequence
Returns:
row index of underlying table row

getBooleanValue

public boolean getBooleanValue(int icol)
Description copied from interface: TupleSequence
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 interface TupleSequence
Parameters:
icol - column index
Returns:
value of element icol in the current row, presumed of boolean type

getDoubleValue

public double getDoubleValue(int icol)
Description copied from interface: TupleSequence
Returns the value of a given column as a double. If that element of the tuple is not of object type, the result may not be useful.

Specified by:
getDoubleValue in interface TupleSequence
Parameters:
icol - column index
Returns:
value of element icol in the current row, presumed of numeric type

getObjectValue

public Object getObjectValue(int icol)
Description copied from interface: TupleSequence
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 following a call to TupleSequence.next().

Specified by:
getObjectValue in interface TupleSequence
Parameters:
icol - column index
Returns:
value of element icol in the current row, presumed of object type


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.