org.das2.dataset
Class ViewDataSet

java.lang.Object
  extended by org.das2.dataset.ViewDataSet
All Implemented Interfaces:
DataSet
Direct Known Subclasses:
XSliceDataSet, YSliceDataSet

public abstract class ViewDataSet
extends java.lang.Object
implements DataSet

A DataSet implementation that share properties, yUnits and yUnits with the instance of AbstractDataSet it is associated with. This class is provided so that sub-classes of AbstractDataSet can extend this class when creating views of their data without having to copy the immutable data AbstractDataSet contains.


Field Summary
 
Fields inherited from interface org.das2.dataset.DataSet
PROPERTY_CACHE_TAG, PROPERTY_FORMATTER, PROPERTY_PLANE_PEAKS, PROPERTY_PLANE_WEIGHTS, PROPERTY_RENDERER, PROPERTY_SIZE_BYTES, PROPERTY_X_LABEL, PROPERTY_X_MONOTONIC, PROPERTY_X_RANGE, PROPERTY_X_TAG_WIDTH, PROPERTY_Y_LABEL, PROPERTY_Y_RANGE, PROPERTY_Y_SCALETYPE, PROPERTY_Y_TAG_WIDTH, PROPERTY_Z_LABEL, PROPERTY_Z_RANGE, PROPERTY_Z_SCALETYPE
 
Constructor Summary
protected ViewDataSet(DataSet source)
           
 
Method Summary
 java.util.Map getProperties()
          Returns all dataset properties in a Map.
 java.lang.Object getProperty(java.lang.String name)
          Returns the value of the property that name represents
 int getXLength()
          Returns the number of x tags in this data set.
 Datum getXTagDatum(int i)
          Returns the value of the x tag at the given index i as a Datum.
 double getXTagDouble(int i, Units units)
          Returns the value of the x tag at the given index i as a double in the given units.
 int getXTagInt(int i, Units units)
          Returns the value of the x tag at the given index i as an int in the given units.
 Units getXUnits()
          Returns the Units object representing the unit type of the x tags for this data set.
 Units getYUnits()
          Returns the Units object representing the unit type of the y tags or y values for this data set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.das2.dataset.DataSet
getPlanarView, getPlaneIds
 

Constructor Detail

ViewDataSet

protected ViewDataSet(DataSet source)
Method Detail

getProperty

public java.lang.Object getProperty(java.lang.String name)
Returns the value of the property that name represents

Specified by:
getProperty in interface DataSet
Parameters:
name - String name of the property requested
Returns:
the value of the property that name represents

getProperties

public java.util.Map getProperties()
Description copied from interface: DataSet
Returns all dataset properties in a Map.

Specified by:
getProperties in interface DataSet
Returns:
a Map of all properties.

getXLength

public int getXLength()
Description copied from interface: DataSet
Returns the number of x tags in this data set. XTags must be monotonically increasing with i.

Specified by:
getXLength in interface DataSet
Returns:
the number of x tags in this data set.

getXTagDatum

public Datum getXTagDatum(int i)
Description copied from interface: DataSet
Returns the value of the x tag at the given index i as a Datum.

Specified by:
getXTagDatum in interface DataSet
Parameters:
i - the index of the requested x tag
Returns:
the value of the x tag at the given index i as a Datum.

getXTagDouble

public double getXTagDouble(int i,
                            Units units)
Description copied from interface: DataSet
Returns the value of the x tag at the given index i as a double in the given units. XTags must be monotonically increasing with i.

Specified by:
getXTagDouble in interface DataSet
Parameters:
i - the index of the requested x tag
units - the units of the returned value
Returns:
the value of the x tag at the given index i as a double.

getXTagInt

public int getXTagInt(int i,
                      Units units)
Description copied from interface: DataSet
Returns the value of the x tag at the given index i as an int in the given units. XTags must be monotonically increasing with i.

Specified by:
getXTagInt in interface DataSet
Parameters:
i - the index of the requested x tag
units - the units of the returned value.
Returns:
the value of the x tag at the given index i as an int.

getXUnits

public Units getXUnits()
Returns the Units object representing the unit type of the x tags for this data set.

Specified by:
getXUnits in interface DataSet
Returns:
the x units

getYUnits

public Units getYUnits()
Returns the Units object representing the unit type of the y tags or y values for this data set.

Specified by:
getYUnits in interface DataSet
Returns:
the y units