T
- type of DataBuffer used to store the data.public interface GJDataVectorInterface<T> extends GJObservableInterface
GJDataVectorInterface
interface defines the methods that
must be implemented by classes representing the x and y data for a 2D plot.
Each GJDataVectorInterface
supports a DataBuffer of class T
that contains the data for the x or y coordinates
Data will be supplied to the paint methods of individual plots via the
getDataValues</>
method. This method returns data as a double
precision vector after transforming the data via a transform set in the host
graph. Thus all plots and data in a single view will share the same
transform. A layered view, with multiple overlapping graphs can be used to
superimpose plots using different transforms
A skeletal implementation of the GJDataVectorInterface
is supplied in
the GJAbstractDataVector
class.
Modifier and Type | Interface and Description |
---|---|
static class |
GJDataVectorInterface.AXIS |
Modifier and Type | Method and Description |
---|---|
void |
clearDataBufferData()
Sets the vector in the DataBuffer to null
This method should fire a PropertyChangeEvent
|
java.lang.Class |
getBufferClass() |
java.util.LinkedHashMap<java.lang.Double,Category> |
getCategories()
Returns the LinkedHasMap of category settings.
|
Category |
getCategory(double val)
Returns the category associated with the specified double value.
|
T |
getDataBuffer()
Returns the DataBuffer.
|
double[] |
getDataValues(GJDataTransformInterface transform)
Returns the data as an IEEE double precision array transformed by the
class specified by
getTranform |
int |
getDimension()
Length of the vector in the DataBuffer
|
java.lang.Object |
getEntry(int index)
Returns a value from the DataBuffer
|
java.lang.String |
getName() |
double[] |
getRawDataValues()
Returns the data as an IEEE double precision array without
applying a transform
|
boolean |
isCategorical()
Determines if this data set is categorical i.e.
|
void |
setCategories(java.util.LinkedHashMap<java.lang.Double,Category> cat)
Sets the LinkedHashMap containing the categories.
|
void |
setCategory(double val,
java.lang.String s)
Associates a
Category containing {code String} s with the
specified double value. |
void |
setDataBuffer(java.lang.Object o)
Sets the DataBuffer used to store the data.
|
void |
setDataBufferData(java.util.AbstractList<? extends java.lang.Number> arr)
Sets the vector in the DataBuffer to the
|
void |
setDataBufferData(double[] arr)
Sets the vector in the DataBuffer to the
|
void |
setDataBufferData(int[] arr)
Sets the vector in the DataBuffer to the
|
void |
setDataBufferData(java.util.Map m)
Sets the vector in the DataBuffer to a series incrementing by 1 for each
element.
|
void |
setEntry(int index,
double val)
Sets a value in the DataBuffer
This method should fire a PropertyChangeEvent when the buffer data are
changed
|
void |
setName(java.lang.String s) |
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, hasSelfListener, removePropertyChangeListener, removePropertyChangeListener
boolean isCategorical()
java.util.LinkedHashMap<java.lang.Double,Category> getCategories()
GJAbstractDataVector#categories categories
in
GJAbstractDataVector
.Category getCategory(double val)
val
- void setCategory(double val, java.lang.String s)
Category
containing {code String} s with the
specified double
value.val
- s
- void setCategories(java.util.LinkedHashMap<java.lang.Double,Category> cat)
cat
- a LinkedHashMapdouble[] getDataValues(GJDataTransformInterface transform)
getTranform
transform
- double[] getRawDataValues()
T getDataBuffer()
T
void setDataBuffer(java.lang.Object o)
o
- the object array or wrapper.int getDimension()
java.lang.Class getBufferClass()
void setDataBufferData(double[] arr)
arr
- void setDataBufferData(int[] arr)
arr
- void setDataBufferData(java.util.AbstractList<? extends java.lang.Number> arr)
arr
- void setDataBufferData(java.util.Map m)
m
must be a Map with a single key, which determines
the start value of the series while the value corresponding to the key
represents the upper limit of the series. TODO: Should this be removed??
This method should fire a PropertyChangeEvent when the buffer data are
changedm
- a Map of size equal to 1.void clearDataBufferData()
java.lang.Object getEntry(int index)
index
- of the required entryvoid setEntry(int index, double val)
index
- val
- the new value as doublejava.lang.String getName()
void setName(java.lang.String s)