Class NumberColumn<C extends NumberColumn<C,​T>,​T extends Number>

    • Field Detail

      • locale

        protected Locale locale
      • comparator

        protected final it.unimi.dsi.fastutil.ints.IntComparator comparator
    • Method Detail

      • createCol

        protected abstract C createCol​(String name,
                                       int size)
      • createCol

        protected abstract C createCol​(String name)
      • set

        public NumberColumn<C,​T> set​(DoublePredicate condition,
                                           NumberColumn<C,​T> other)
        Updates this column where values matching the selection are replaced with the corresponding value from the given column
      • set

        public NumberColumn<C,​T> set​(DoublePredicate condition,
                                           T newValue)
        Sets the value of all elements in this column matching condition to be equal to newValue and returns this column
      • getPrintFormatter

        protected NumberColumnFormatter getPrintFormatter()
        Returns the NumbetPrintFormatter for this column, or null
      • top

        public abstract NumericColumn<T> top​(int n)
        Returns the largest ("top") n values in the column TODO(lwhite): Consider whether this should exclude missing
        Parameters:
        n - The maximum number of records to return. The actual number will be smaller if n is greater than the number of observations in the column
        Returns:
        A list, possibly empty, of the largest observations
      • bottom

        public abstract NumericColumn<T> bottom​(int n)
        Returns the smallest ("bottom") n values in the column TODO(lwhite): Consider whether this should exclude missing
        Parameters:
        n - The maximum number of records to return. The actual number will be smaller if n is greater than the number of observations in the column
        Returns:
        A list, possibly empty, of the smallest n observations
      • getString

        public String getString​(int row)
        Returns a string representation of the value at the given row.
        Specified by:
        getString in interface Column<C extends NumberColumn<C,​T>>
        Parameters:
        row - The index of the row.
        Returns:
        value as String
      • emptyCopy

        public C emptyCopy​(int rowSize)
        Returns an empty copy of the receiver, with its internal storage initialized to the given row size.
        Specified by:
        emptyCopy in interface Column<C extends NumberColumn<C,​T>>
        Parameters:
        rowSize - the initial row size
        Returns:
        a Column
      • rowComparator

        public it.unimi.dsi.fastutil.ints.IntComparator rowComparator()
        Compares the given ints, which refer to the indexes of the doubles in this column, according to the values of the doubles themselves
        Specified by:
        rowComparator in interface Column<C extends NumberColumn<C,​T>>
      • byteSize

        public int byteSize()
        Returns the width of a cell in this column, in bytes.
        Specified by:
        byteSize in interface Column<C extends NumberColumn<C,​T>>
        Returns:
        width in bytes
      • countMissing

        public int countMissing()
        Returns the count of missing values in this column
        Specified by:
        countMissing in interface Column<C extends NumberColumn<C,​T>>
        Returns:
        missing values as int