com.approximatrix.charting.model
Class DefaultDataSet

java.lang.Object
  extended by com.approximatrix.charting.model.DefaultDataSet
All Implemented Interfaces:
DataSet
Direct Known Subclasses:
EditableDataSet

public class DefaultDataSet
extends java.lang.Object
implements DataSet

This is a default DataSet implementation.

Version:
1.0
Author:
mueller

Field Summary
protected  int axis
           
protected  java.util.ArrayList columns
           
protected  java.util.ArrayList data
           
protected  java.lang.String title
           
 
Constructor Summary
DefaultDataSet()
          Creates a new empty DefaultDataSet with default axis binding.
DefaultDataSet(int axis)
          Creates a new empty DefaultDataSet with the given Axis binding.
DefaultDataSet(java.lang.Object[] data, java.lang.Object[] columns, int axis)
          Creates a new DefaultDataSet with the given data and the Axis binding.
DefaultDataSet(java.lang.Object[] data, java.lang.Object[] columns, int axis, java.lang.String title)
          Creates a new DefaultDataSet with the given data and the Axis binding.
 
Method Summary
 java.lang.Object getColumnValueAt(int index)
          Returns the column value.
 int getDataSetLength()
          Returns the length of this data set, ie the minimum of the columns and the data array length.
 java.lang.String getTitle()
          Returns the title of this DataSet.
 java.lang.Object getValueAt(int index)
          Returns the data at the specified index.
 int getYAxis()
          Returns the Axis binding.
 void setColumnValueAt(int index, java.lang.Object col)
          Sets a column value.
 void setTitle(java.lang.String title)
          Sets the title of this DataSet.
 void setValueAt(int index, java.lang.Object val)
          Sets the given value at the specified index.
 void setYAxis(int yaxis)
          Sets the Axis binding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected java.util.ArrayList data

columns

protected java.util.ArrayList columns

axis

protected int axis

title

protected java.lang.String title
Constructor Detail

DefaultDataSet

public DefaultDataSet()
Creates a new empty DefaultDataSet with default axis binding.


DefaultDataSet

public DefaultDataSet(int axis)
Creates a new empty DefaultDataSet with the given Axis binding.


DefaultDataSet

public DefaultDataSet(java.lang.Object[] data,
                      java.lang.Object[] columns,
                      int axis)
Creates a new DefaultDataSet with the given data and the Axis binding.

Parameters:
data - the DataSet values
columns - the DataSet columns, the value and the column array should have the same length. The columns have to be sorted.
axis - the Axis binding

DefaultDataSet

public DefaultDataSet(java.lang.Object[] data,
                      java.lang.Object[] columns,
                      int axis,
                      java.lang.String title)
Creates a new DefaultDataSet with the given data and the Axis binding.

Parameters:
data - the DataSet values
columns - the DataSet columns, the value and the column array should have the same length. The columns have to be sorted.
axis - the Axis binding
Method Detail

getDataSetLength

public int getDataSetLength()
Returns the length of this data set, ie the minimum of the columns and the data array length.

Specified by:
getDataSetLength in interface DataSet
Returns:
the length of the DataSet

getValueAt

public java.lang.Object getValueAt(int index)
Returns the data at the specified index.

Specified by:
getValueAt in interface DataSet
Parameters:
index - the data index
Returns:
the Object value

getYAxis

public int getYAxis()
Returns the Axis binding.

Specified by:
getYAxis in interface DataSet
Returns:
the axis binding constant

setValueAt

public void setValueAt(int index,
                       java.lang.Object val)
Sets the given value at the specified index.

Specified by:
setValueAt in interface DataSet
Parameters:
index - the value index
val - the Object value

setYAxis

public void setYAxis(int yaxis)
Sets the Axis binding.

Specified by:
setYAxis in interface DataSet
Parameters:
yaxis - the axis binding constant

getColumnValueAt

public java.lang.Object getColumnValueAt(int index)
Returns the column value.

Specified by:
getColumnValueAt in interface DataSet
Parameters:
index - the column index
Returns:
the column value

setColumnValueAt

public void setColumnValueAt(int index,
                             java.lang.Object col)
Sets a column value.

Specified by:
setColumnValueAt in interface DataSet
Parameters:
index - the column index
col - the column value

setTitle

public void setTitle(java.lang.String title)
Sets the title of this DataSet.

Specified by:
setTitle in interface DataSet
Parameters:
title - the String title

getTitle

public java.lang.String getTitle()
Returns the title of this DataSet.

Specified by:
getTitle in interface DataSet
Returns:
the String title