org.das2.dataset
Class DefaultVectorDataSet

java.lang.Object
  extended by org.das2.dataset.AbstractDataSet
      extended by org.das2.dataset.AbstractVectorDataSet
          extended by org.das2.dataset.DefaultVectorDataSet
All Implemented Interfaces:
DataSet, VectorDataSet

public final class DefaultVectorDataSet
extends AbstractVectorDataSet
implements DataSet, VectorDataSet


Nested Class Summary
 
Nested classes/interfaces inherited from class org.das2.dataset.AbstractDataSet
AbstractDataSet.ViewDataSet
 
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
DefaultVectorDataSet(double[] xTags, Units xUnits, double[] yValues, Units yUnits, java.util.Map properties)
          Creates a new instance of DefaultVectorDataSet
DefaultVectorDataSet(double[] xTags, Units xUnits, double[] yValues, Units yUnits, java.util.Map yValuesMap, java.util.Map yUnitsMap, java.util.Map properties)
          Creates a new instance of DefaultVectorDataSet The keys for the properties, yValuesMap, and unitsMap parameter must consist solely of String values.
 
Method Summary
 Datum getDatum(int i)
          Returns the Y value for the given index into the x tags as a Datum.
 double getDouble(int i, Units units)
          Returns the Y value for the given index into the x tags as a double with the given units.
 int getInt(int i, Units units)
          Returns the Y value for the given index into the x tags as a int with the given units.
 DataSet getPlanarView(java.lang.String planeID)
          Returns a DataSet with the specified view as the primary view.
 java.lang.String[] getPlaneIds()
          Returns a list of auxillary planes (e.g.
 
Methods inherited from class org.das2.dataset.AbstractVectorDataSet
toString
 
Methods inherited from class org.das2.dataset.AbstractDataSet
getProperties, getProperty, getXLength, getXTagDatum, getXTagDouble, getXTagInt, getXUnits, getYUnits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.das2.dataset.DataSet
getProperties, getProperty, getXLength, getXTagDatum, getXTagDouble, getXTagInt, getXUnits, getYUnits
 

Constructor Detail

DefaultVectorDataSet

public DefaultVectorDataSet(double[] xTags,
                            Units xUnits,
                            double[] yValues,
                            Units yUnits,
                            java.util.Map properties)
Creates a new instance of DefaultVectorDataSet

Parameters:
xTags - array of double x tag values
xUnits - units for the x tags
yValues - array of double y values
yUnits - untis for the y values
properties - map of String property names to their values

DefaultVectorDataSet

public DefaultVectorDataSet(double[] xTags,
                            Units xUnits,
                            double[] yValues,
                            Units yUnits,
                            java.util.Map yValuesMap,
                            java.util.Map yUnitsMap,
                            java.util.Map properties)
Creates a new instance of DefaultVectorDataSet The keys for the properties, yValuesMap, and unitsMap parameter must consist solely of String values. If any of these key sets contain non-string values an IllegalArgumentException will be thrown. The key set of the yUnitsMap parameter must match exactly the key set of the yValuesMap. If their key sets do not exactly match, an IllegalArgumentException will be thrown.

Parameters:
xTags - array of double x tag values
xUnits - units for the x tags
yValues - array of double y values
yUnits - untis for the y values
yValuesMap - map of String plane IDs to their y values
properties - map of String property names to their values
Method Detail

getDatum

public Datum getDatum(int i)
Returns the Y value for the given index into the x tags as a Datum.

Specified by:
getDatum in interface VectorDataSet
Parameters:
i - index of the x tag for the requested value.
Returns:
the value at index location i as a Datum

getDouble

public double getDouble(int i,
                        Units units)
Returns the Y value for the given index into the x tags as a double with the given units.

Specified by:
getDouble in interface VectorDataSet
Parameters:
i - index of the x tag for the requested value.
units - the units the returned value should be coverted to.
Returns:
the value at index location i as a double.

getInt

public int getInt(int i,
                  Units units)
Returns the Y value for the given index into the x tags as a int with the given units.

Specified by:
getInt in interface VectorDataSet
Parameters:
i - index of the x tag for the requested value.
units - the units the returned value should be coverted to.
Returns:
the value at index location i as a int.

getPlanarView

public DataSet getPlanarView(java.lang.String planeID)
Returns a DataSet with the specified view as the primary view.

Specified by:
getPlanarView in interface DataSet
Parameters:
planeID - the String id of the requested plane.
Returns:
the specified view, as a DataSet

getPlaneIds

public java.lang.String[] getPlaneIds()
Description copied from interface: DataSet
Returns a list of auxillary planes (e.g. weights, peaks) for the dataset. Note that the default plane, "" may or may not be returned, based on implementations.

Specified by:
getPlaneIds in interface DataSet