org.virbo.dataset
Class AbstractDataSet

java.lang.Object
  extended by org.virbo.dataset.AbstractDataSet
All Implemented Interfaces:
MutablePropertyDataSet, QDataSet
Direct Known Subclasses:
BDataSet, DDataSet, FDataSet, IDataSet, IndexGenDataSet, SDataSet, Slice0DataSet, Slice1DataSet, SortDataSet, TransposeRank2DataSet, TransposeRankNDataSet, TrimStrideWrapper

public abstract class AbstractDataSet
extends java.lang.Object
implements QDataSet, MutablePropertyDataSet

Abstract class to simplify defining datasets. Implement rank, and override value and length.


Field Summary
protected  java.util.HashMap properties
           
 
Fields inherited from interface org.virbo.dataset.QDataSet
CACHE_TAG, CADENCE, COORDINATE_FRAME, DELTA_MINUS, DELTA_PLUS, DEPEND_0, DEPEND_1, DEPEND_2, FILL_VALUE, LABEL, MAX_PLANE_COUNT, MAX_RANK, MONOTONIC, NAME, PLANE_0, QUBE, RENDER_TYPE, SCALE_TYPE, TITLE, TYPICAL_MAX, TYPICAL_MIN, UNITS, USER_PROPERTIES, VALID_MAX, VALID_MIN, WEIGHTS_PLANE
 
Constructor Summary
AbstractDataSet()
           
 
Method Summary
 int length()
          return the length of the first dimension
 int length(int i)
          return the length of the second dimension, for the ith element of the first dimension
 int length(int i, int j)
          return the length of the third dimension, for the ith element of the first dimension and jth element of the second dimension.
 java.lang.Object property(java.lang.String name)
          accessor for properties attached to the dataset.
 java.lang.Object property(java.lang.String name, int i)
          accessor for properties attached to the dataset's first index.
 java.lang.Object property(java.lang.String name, int i0, int i1)
          accessor for properties attached to the dataset's second index.
 void putProperty(java.lang.String name, int index1, int index2, java.lang.Object value)
           
 void putProperty(java.lang.String name, int index, java.lang.Object value)
           
 void putProperty(java.lang.String name, java.lang.Object value)
           
abstract  int rank()
          returns the rank of the dataset, which is the number of indeces used to access data.
 java.lang.String toString()
           
 double value(int i)
          rank 1 accessor.
 double value(int i0, int i1)
          rank 2 accessor.
 double value(int i0, int i1, int i2)
          rank 3 accessor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

properties

protected java.util.HashMap properties
Constructor Detail

AbstractDataSet

public AbstractDataSet()
Method Detail

rank

public abstract int rank()
Description copied from interface: QDataSet
returns the rank of the dataset, which is the number of indeces used to access data. Only rank 1, 2, and 3 datasets are supported in the interface. When a dataset's rank is 4 or greater, it should implement the HighRankDataSet interface which affords a slice operation to reduce rank. When a dataset's rank is 0, it should implement the RankZeroDataSet interface, which has a no-argument accessor. (TODO: Note that rank 0 and rank N have very limited use, so many routines aren't coded to handle them.)

Specified by:
rank in interface QDataSet

value

public double value(int i)
Description copied from interface: QDataSet
rank 1 accessor.

Specified by:
value in interface QDataSet

value

public double value(int i0,
                    int i1)
Description copied from interface: QDataSet
rank 2 accessor.

Specified by:
value in interface QDataSet

value

public double value(int i0,
                    int i1,
                    int i2)
Description copied from interface: QDataSet
rank 3 accessor.

Specified by:
value in interface QDataSet

property

public java.lang.Object property(java.lang.String name)
Description copied from interface: QDataSet
accessor for properties attached to the dataset. See final static members for example properties.

Specified by:
property in interface QDataSet

property

public java.lang.Object property(java.lang.String name,
                                 int i)
Description copied from interface: QDataSet
accessor for properties attached to the dataset's first index. These properties override (or shadow) properties attached to the dataset, and often implementations will simply return the result of the no-index accessor.

Specified by:
property in interface QDataSet

property

public java.lang.Object property(java.lang.String name,
                                 int i0,
                                 int i1)
Description copied from interface: QDataSet
accessor for properties attached to the dataset's second index. These properties override (or shadow) properties attached to the dataset's first index, and often implementations will simply return the result of the one-index (or zero-index) accessor.

Specified by:
property in interface QDataSet

putProperty

public void putProperty(java.lang.String name,
                        java.lang.Object value)
Specified by:
putProperty in interface MutablePropertyDataSet

putProperty

public void putProperty(java.lang.String name,
                        int index,
                        java.lang.Object value)
Specified by:
putProperty in interface MutablePropertyDataSet

putProperty

public void putProperty(java.lang.String name,
                        int index1,
                        int index2,
                        java.lang.Object value)
Specified by:
putProperty in interface MutablePropertyDataSet

length

public int length()
Description copied from interface: QDataSet
return the length of the first dimension

Specified by:
length in interface QDataSet

length

public int length(int i)
Description copied from interface: QDataSet
return the length of the second dimension, for the ith element of the first dimension

Specified by:
length in interface QDataSet

length

public int length(int i,
                  int j)
Description copied from interface: QDataSet
return the length of the third dimension, for the ith element of the first dimension and jth element of the second dimension.

Specified by:
length in interface QDataSet

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object