Package uk.ac.starlink.ttools.plot
Class WrapperPointSequence
- java.lang.Object
-
- uk.ac.starlink.ttools.plot.WrapperPointSequence
-
- All Implemented Interfaces:
PointSequence
public class WrapperPointSequence extends java.lang.Object implements PointSequence
PointSequence implementation based on an existing PointSequence object. All behaviour is delegated to the base.- Since:
- 24 Apr 2008
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description WrapperPointSequence(PointSequence base)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Call when this sequence is no longer required.double[][]getErrors()Reads the errors for the current row.java.lang.StringgetLabel()Returns any text label associated with the current point.double[]getPoint()Reads the coordinates of the current point.booleanisIncluded(int iset)Indicates whether the current row is included in the given subset.booleannext()Attempts to advance the current row to the next one.
-
-
-
Constructor Detail
-
WrapperPointSequence
public WrapperPointSequence(PointSequence base)
Constructor.- Parameters:
base- base object
-
-
Method Detail
-
next
public boolean next()
Description copied from interface:PointSequenceAttempts to advance the current row to the next one. Iftrueis returned the attempt has been successful, and iffalseis returned there are no more rows in this sequence. Since the initial position of this sequence is before the first row, this method must be called before calling any of the data access methods.- Specified by:
nextin interfacePointSequence- Returns:
- true if row advance has succeeded, false for end of sequence
-
getPoint
public double[] getPoint()
Description copied from interface:PointSequenceReads the coordinates of the current point. The returned array may be modified by subsequent calls to this method. The caller is also permitted to modify it.- Specified by:
getPointin interfacePointSequence- Returns:
- coords an ndim-element array containing point coordinates
-
getErrors
public double[][] getErrors()
Description copied from interface:PointSequenceReads the errors for the current row. The returned value is an array ofnerrordouble[] arrays, each of which hasndimelements and represents the coordinates of the end of an error bar. If any of these coordinate arrays isnull, it represents an error bar of zero size, that is one whose end sits right on the data point. The ordering of these points is up to the user of this object, but typically they will be in pairs, e.g. (xlo,xhi, ylo,hi, ...). The content of the returned double[][] array and of its elements may be modified by subsequent calls to this method. The caller is also permitted to modify these.- Specified by:
getErrorsin interfacePointSequence- Returns:
- double[nerr][ndim] array with error extremum coordinates
-
getLabel
public java.lang.String getLabel()
Description copied from interface:PointSequenceReturns any text label associated with the current point.- Specified by:
getLabelin interfacePointSequence- Returns:
- text label, or null
-
isIncluded
public boolean isIncluded(int iset)
Description copied from interface:PointSequenceIndicates whether the current row is included in the given subset.- Specified by:
isIncludedin interfacePointSequence- Returns:
- true iff set
isetis included
-
close
public void close()
Description copied from interface:PointSequenceCall when this sequence is no longer required.- Specified by:
closein interfacePointSequence
-
-