com.approximatrix.charting.model
Class EditableDataSet

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

public class EditableDataSet
extends DefaultDataSet

This is an editable DataSet implementation.

Version:
1.0
Author:
mueller

Field Summary
 
Fields inherited from class com.approximatrix.charting.model.DefaultDataSet
axis, columns, data, title
 
Constructor Summary
EditableDataSet()
          Creates a new empty EditableDataSet with default axis binding.
EditableDataSet(int axis)
          Creates a new empty EditableDataSet with the given Axis binding.
EditableDataSet(java.lang.Object[] data, java.lang.Object[] columns, int axis)
          Creates a new EditableDataSet with the given data and the Axis binding.
EditableDataSet(java.lang.Object[] data, java.lang.Object[] columns, int axis, java.lang.String title)
          Creates a new EditableDataSet with the given data and the Axis binding.
 
Method Summary
 void insertValue(java.lang.Object value, java.lang.Object column)
          Inserts the given column/value pair at the right position, which is determined through a binary search.
 void removeValue(int index)
          Removes a given column/value pair at the specified index location with no regards for safety.
 
Methods inherited from class com.approximatrix.charting.model.DefaultDataSet
getColumnValueAt, getDataSetLength, getTitle, getValueAt, getYAxis, setColumnValueAt, setTitle, setValueAt, setYAxis
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditableDataSet

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


EditableDataSet

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


EditableDataSet

public EditableDataSet(java.lang.Object[] data,
                       java.lang.Object[] columns,
                       int axis)
Creates a new EditableDataSet 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 column array has to be sorted.
axis - the Axis binding

EditableDataSet

public EditableDataSet(java.lang.Object[] data,
                       java.lang.Object[] columns,
                       int axis,
                       java.lang.String title)
Creates a new EditableDataSet 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 column array has to be sorted!
axis - the Axis binding
Method Detail

insertValue

public void insertValue(java.lang.Object value,
                        java.lang.Object column)
Inserts the given column/value pair at the right position, which is determined through a binary search. If the column is contained in the column set, setValueAt is called.

Parameters:
value - the value to be stored
column - the column value corresponding to value

removeValue

public void removeValue(int index)
Removes a given column/value pair at the specified index location with no regards for safety.

Parameters:
index - the index of the pair to remove