org.statcato.utils
Class NumDataset

java.lang.Object
  extended by org.statcato.utils.NumDataset

public class NumDataset
extends java.lang.Object

A class that represents a dataset of double values. The dataset consists of vectors of double values corresponding to distinct category labels.

Since:
1.0
Version:
%I%, %G%
Author:
Margaret Yau

Constructor Summary
NumDataset()
          Constructor.
 
Method Summary
 void add(java.util.Vector<java.lang.Double> data, java.lang.String label)
          Adds the given data vector with the given label to the dataset.
 void addDataVectorWithByVarLabels(java.util.Vector<java.lang.Double> data, java.util.Vector byLabels)
          Add the data values with the corresponding labels.
 java.util.Vector<java.lang.Double> get(java.lang.String label)
          Returns the data vector corresponding to the given label.
 java.util.Vector<java.lang.String> getLabels()
          Returns all the labels as a vector of string values.
 java.util.Vector<java.util.Vector<java.lang.Double>> getValues()
          Returns all the data values as vectors of double-value vector.
 int size()
          Returns the size of the dataset (number of categories).
 java.lang.String toString()
          Returns the labels of the sets of data values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NumDataset

public NumDataset()
Constructor.

Method Detail

add

public void add(java.util.Vector<java.lang.Double> data,
                java.lang.String label)
Adds the given data vector with the given label to the dataset.

Parameters:
data - vector of double values
label - String data label

addDataVectorWithByVarLabels

public void addDataVectorWithByVarLabels(java.util.Vector<java.lang.Double> data,
                                         java.util.Vector byLabels)
Add the data values with the corresponding labels.

Parameters:
data - vector of double values
byLabels - vector of labels corresponding to the double values

get

public java.util.Vector<java.lang.Double> get(java.lang.String label)
Returns the data vector corresponding to the given label.

Parameters:
label - String data label
Returns:
vector of double values corresponding to the given label

size

public int size()
Returns the size of the dataset (number of categories).

Returns:
size of the dataset (integer)

getValues

public java.util.Vector<java.util.Vector<java.lang.Double>> getValues()
Returns all the data values as vectors of double-value vector.

Returns:
vectors of double-value vector

getLabels

public java.util.Vector<java.lang.String> getLabels()
Returns all the labels as a vector of string values.

Returns:
vector of string values

toString

public java.lang.String toString()
Returns the labels of the sets of data values.

Overrides:
toString in class java.lang.Object
Returns:
vector of string values