Documentation of 'de.erichseifert.gral.data.DataAccessor' Java class
DataAccessor
de.erichseifert.gral.data

Class DataAccessor

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<java.lang.Comparable<?>>
    Direct Known Subclasses:
    Row


    public abstract class DataAccessor
    extends java.lang.Object
    implements java.lang.Iterable<java.lang.Comparable<?>>, java.io.Serializable
    Abstract base for reading substructures of a data source, i.e. columns or rows. DataAccessors are iterable and provide utility methods for statistics and array conversion.
    See Also:
    DataSource, Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      DataAccessor(DataSource source, int index)
      Initializes a new instance with the specified data source and an access index.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object obj) 
      abstract java.lang.Comparable<?> get(int index)
      Returns the value of the data source for the specified index.
      int getIndex()
      Returns the index to access the data source.
      DataSource getSource()
      Returns the data source containing this column.
      double getStatistics(java.lang.String key)
      Returns the specified statistical information for this data.
      int hashCode() 
      java.util.Iterator<java.lang.Comparable<?>> iterator()
      Returns an iterator over the elements of this object.
      abstract int size()
      Returns the number of elements in this column.
      java.lang.Comparable<?>[] toArray(java.lang.Comparable<?>[] data)
      Converts the data column to an array.
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • DataAccessor

        public DataAccessor(DataSource source,
                            int index)
        Initializes a new instance with the specified data source and an access index.
        Parameters:
        source - Data source.
        index - Column index.
    • Method Detail

      • getSource

        public DataSource getSource()
        Returns the data source containing this column.
        Returns:
        Data source containing this column.
      • getIndex

        public int getIndex()
        Returns the index to access the data source.
        Returns:
        Data index.
      • get

        public abstract java.lang.Comparable<?> get(int index)
        Returns the value of the data source for the specified index.
        Parameters:
        index - Index.
        Returns:
        Value of the accessed cell.
      • size

        public abstract int size()
        Returns the number of elements in this column.
        Returns:
        Number of elements
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toArray

        public java.lang.Comparable<?>[] toArray(java.lang.Comparable<?>[] data)
        Converts the data column to an array.
        Parameters:
        data - Optional array as data sink. If array is null a new array will be created.
        Returns:
        Array with row data;
      • getStatistics

        public double getStatistics(java.lang.String key)
        Returns the specified statistical information for this data.
        Parameters:
        key - Requested Statistical information.
        Returns:
        Calculated value.
      • iterator

        public java.util.Iterator<java.lang.Comparable<?>> iterator()
        Returns an iterator over the elements of this object.
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.Comparable<?>>
        Returns:
        an iterator.

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.