Documentation of 'kcl.waterloo.graphics.data.GJDataVectorInterface' Java class
GJDataVectorInterface
kcl.waterloo.graphics.data

Interface GJDataVectorInterface<T>

  • Type Parameters:
    T - type of DataBuffer used to store the data.
    All Superinterfaces:
    java.util.EventListener, GJObservableInterface, java.beans.PropertyChangeListener
    All Known Implementing Classes:
    GJAbstractDataVector, GJBigDecimalDataVector, GJDoubleDataVector, GJFloatDataVector, GJPrimitiveDoubleDataVector


    public interface GJDataVectorInterface<T>
    extends GJObservableInterface
    The GJDataVectorInterface interface defines the methods that must be implemented by classes representing the x and y data for a 2D plot.

    Each GJDataVectorInterfacesupports 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 GJDataVectorInterfaceis supplied in the GJAbstractDataVector class.

    • Method Detail

      • isCategorical

        boolean isCategorical()
        Determines if this data set is categorical i.e. has that categories is non-null.
        Returns:
        true if Categories != null
      • getCategories

        java.util.LinkedHashMap<java.lang.Double,Category> getCategories()
        Returns the LinkedHasMap of category settings. See GJAbstractDataVector#categories categories in GJAbstractDataVector.
        Returns:
        a LinkedHashMap
      • getCategory

        Category getCategory(double val)
        Returns the category associated with the specified double value.
        Parameters:
        val -
        Returns:
        a Category
      • setCategory

        void setCategory(double val,
                         java.lang.String s)
        Associates a Category containing {code String} s with the specified double value.
        Parameters:
        val -
        s -
      • setCategories

        void setCategories(java.util.LinkedHashMap<java.lang.Double,Category> cat)
        Sets the LinkedHashMap containing the categories.
        Parameters:
        cat - a LinkedHashMap map.
      • getDataValues

        double[] getDataValues(GJDataTransformInterface transform)
        Returns the data as an IEEE double precision array transformed by the class specified by getTranform
        Parameters:
        transform -
        Returns:
        a double[]
      • getRawDataValues

        double[] getRawDataValues()
        Returns the data as an IEEE double precision array without applying a transform
        Returns:
        a double[]
      • getDataBuffer

        T getDataBuffer()
        Returns the DataBuffer.
        Returns:
        DataBuffer of type T
      • setDataBuffer

        void setDataBuffer(java.lang.Object o)
        Sets the DataBuffer used to store the data. The buffer will be copied by reference.
        Parameters:
        o - the object array or wrapper.
      • getDimension

        int getDimension()
        Length of the vector in the DataBuffer
        Returns:
        the length of the vector
      • getBufferClass

        java.lang.Class getBufferClass()
        Returns:
        the class of the DataBuffer
      • setDataBufferData

        void setDataBufferData(double[] arr)
        Sets the vector in the DataBuffer to the values in the input. Data may be cast and lose precision in the copy process. This method should fire a PropertyChangeEvent when the buffer data are changed
        Parameters:
        arr -
      • setDataBufferData

        void setDataBufferData(int[] arr)
        Sets the vector in the DataBuffer to the values in the input. Data may be cast and lose precision in the copy process. This method should fire a PropertyChangeEvent when the buffer data are changed
        Parameters:
        arr -
      • setDataBufferData

        void setDataBufferData(java.util.AbstractList<? extends java.lang.Number> arr)
        Sets the vector in the DataBuffer to the values in the input. Data may be cast and lose precision in the copy process. This method should fire a PropertyChangeEvent when the buffer data are changed
        Parameters:
        arr -
      • setDataBufferData

        void setDataBufferData(java.util.Map m)
        Sets the vector in the DataBuffer to a series incrementing by 1 for each element. 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 changed
        Parameters:
        m - a Map of size equal to 1.
      • clearDataBufferData

        void clearDataBufferData()
        Sets the vector in the DataBuffer to null This method should fire a PropertyChangeEvent
      • getEntry

        java.lang.Object getEntry(int index)
        Returns a value from the DataBuffer
        Parameters:
        index - of the required entry
        Returns:
        the value a a double
      • setEntry

        void setEntry(int index,
                      double val)
        Sets a value in the DataBuffer This method should fire a PropertyChangeEvent when the buffer data are changed
        Parameters:
        index -
        val - the new value as double
      • getName

        java.lang.String getName()
      • setName

        void setName(java.lang.String s)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.