kcl.waterloo.graphics.data
Class GJAbstractDataVector<T>
- java.lang.Object
-
- kcl.waterloo.observable.GJAbstractObservable
-
- kcl.waterloo.graphics.data.GJAbstractDataVector<T>
-
- Type Parameters:
T-
- All Implemented Interfaces:
- java.beans.PropertyChangeListener, java.util.EventListener, GJDataVectorInterface<T>, GJLinkableInterface, GJObservableInterface
- Direct Known Subclasses:
- GJBigDecimalDataVector, GJDoubleDataVector, GJFloatDataVector, GJPrimitiveDoubleDataVector
public abstract class GJAbstractDataVector<T> extends GJAbstractObservable implements GJDataVectorInterface<T>
Abstract implementaion of theGJDataVectorInterfaceinterface. For details see the doc for theGJDataVectorInterfaceinterface.GJDataVectorInterfacesare used for the XData and YData fields in the plot data model.- See Also:
GJDataVectorInterface
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface kcl.waterloo.graphics.data.GJDataVectorInterface
GJDataVectorInterface.AXIS
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclearDataBufferData()Sets the vector in the DataBuffer to null This method should fire a PropertyChangeEventjava.lang.ClassgetBufferClass()java.util.LinkedHashMap<java.lang.Double,Category>getCategories()Returns the LinkedHasMap of category settings.CategorygetCategory(double val)Returns the category associated with the specified double value.TgetDataBuffer()Returns the DataBuffer.java.lang.ObjectgetEntry(int index)Returns a value from the DataBufferjava.lang.StringgetName()booleanisCategorical()Determines if this data set is categorical i.e.voidpropertyChange(java.beans.PropertyChangeEvent pce)voidsetCategories(java.util.LinkedHashMap<java.lang.Double,Category> cat)Sets the LinkedHashMap containing the categories.voidsetCategories(java.lang.String... cat)voidsetCategory(double index, java.lang.String val)Associates aCategorycontaining {code String} s with the specifieddoublevalue.voidsetDataBuffer(java.lang.Object buffer)Sets the DataBuffer used to store the data.voidsetDataBufferData(java.util.Map m)Sets the vector in the DataBuffer to a series incrementing by 1 for each element.voidsetName(java.lang.String s)-
Methods inherited from class kcl.waterloo.observable.GJAbstractObservable
addLink, addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getLinks, getPCS, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, hasSelfListener, removeLink, removePropertyChangeListener, removePropertyChangeListener, setLinks
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface kcl.waterloo.graphics.data.GJDataVectorInterface
getDataValues, getDimension, getRawDataValues, setDataBufferData, setDataBufferData, setDataBufferData, setEntry
-
Methods inherited from interface kcl.waterloo.observable.GJObservableInterface
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, hasSelfListener, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Method Detail
-
clearDataBufferData
public void clearDataBufferData()
Sets the vector in the DataBuffer to null This method should fire a PropertyChangeEvent- Specified by:
clearDataBufferDatain interfaceGJDataVectorInterface<T>
-
setDataBuffer
public final void setDataBuffer(java.lang.Object buffer)
Description copied from interface:GJDataVectorInterfaceSets the DataBuffer used to store the data. The buffer will be copied by reference.- Specified by:
setDataBufferin interfaceGJDataVectorInterface<T>- Parameters:
buffer- the object array or wrapper.
-
getDataBuffer
public final T getDataBuffer()
Description copied from interface:GJDataVectorInterfaceReturns the DataBuffer.- Specified by:
getDataBufferin interfaceGJDataVectorInterface<T>- Returns:
- DataBuffer of type
T
-
getEntry
public final java.lang.Object getEntry(int index)
Description copied from interface:GJDataVectorInterfaceReturns a value from the DataBuffer- Specified by:
getEntryin interfaceGJDataVectorInterface<T>- Parameters:
index- of the required entry- Returns:
- the value a a double
-
isCategorical
public boolean isCategorical()
Determines if this data set is categorical i.e. has that categories is non-null.- Specified by:
isCategoricalin interfaceGJDataVectorInterface<T>- Returns:
- true if Categories != null
-
setCategory
public void setCategory(double index, java.lang.String val)Associates aCategorycontaining {code String} s with the specifieddoublevalue.- Specified by:
setCategoryin interfaceGJDataVectorInterface<T>- Parameters:
index-val-
-
getCategories
public java.util.LinkedHashMap<java.lang.Double,Category> getCategories()
Returns the LinkedHasMap of category settings. SeeGJAbstractDataVector#categories categoriesinGJAbstractDataVector.- Specified by:
getCategoriesin interfaceGJDataVectorInterface<T>- Returns:
- a LinkedHashMap
-
getCategory
public Category getCategory(double val)
Description copied from interface:GJDataVectorInterfaceReturns the category associated with the specified double value.- Specified by:
getCategoryin interfaceGJDataVectorInterface<T>- Returns:
- a Category
-
setCategories
public void setCategories(java.util.LinkedHashMap<java.lang.Double,Category> cat)
Sets the LinkedHashMap containing the categories.- Specified by:
setCategoriesin interfaceGJDataVectorInterface<T>- Parameters:
cat- a LinkedHashMapmap.
-
setCategories
public void setCategories(java.lang.String... cat)
-
getBufferClass
public final java.lang.Class getBufferClass()
- Specified by:
getBufferClassin interfaceGJDataVectorInterface<T>- Returns:
- the class of the DataBuffer
-
setDataBufferData
public void setDataBufferData(java.util.Map m)
Sets the vector in the DataBuffer to a series incrementing by 1 for each element.mmust 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 changed- Specified by:
setDataBufferDatain interfaceGJDataVectorInterface<T>- Parameters:
m- a Map of size equal to 1.
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceGJDataVectorInterface<T>
-
setName
public void setName(java.lang.String s)
- Specified by:
setNamein interfaceGJDataVectorInterface<T>
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent pce)
- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener
-
-
DMelt 3.0 © DataMelt by jWork.ORG