Class TimeColumn

    • Field Detail

      • data

        protected it.unimi.dsi.fastutil.ints.IntArrayList data
    • Method Detail

      • valueHash

        public int valueHash​(int rowNumber)
        Returns an int suitable as a hash for the value in this column at the given index
        Specified by:
        valueHash in interface Column<LocalTime>
      • equals

        public boolean equals​(int rowNumber1,
                              int rowNumber2)
        Returns true if the value in this column at rowNumber1 is equal to the value at rowNumber2
        Specified by:
        equals in interface Column<LocalTime>
      • createInternal

        public static TimeColumn createInternal​(String name,
                                                int[] data)
      • valueIsMissing

        public static boolean valueIsMissing​(int i)
      • lag

        public TimeColumn lag​(int n)
        Returns a column of the same type and size as the receiver, containing the receivers values offset by n.

        For example if you lag a column containing 2, 3, 4 by 1, you get a column containing NA, 2, 3

        Specified by:
        lag in interface Column<LocalTime>
        Specified by:
        lag in interface TimeMapFunctions
      • isMissing

        public boolean isMissing​(int rowNumber)
        Returns true if the value at rowNumber is missing
        Specified by:
        isMissing in interface Column<LocalTime>
      • size

        public int size()
        Returns the number of elements in this column, including missing values
        Specified by:
        size in interface Column<LocalTime>
      • appendInternal

        public TimeColumn appendInternal​(int f)
      • getString

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

        public String getUnformattedString​(int row)
        Returns a String representation of the value at index r, without any formatting applied
        Specified by:
        getUnformattedString in interface Column<LocalTime>
      • setPrintFormatter

        public void setPrintFormatter​(DateTimeFormatter dateTimeFormatter,
                                      String missingValueString)
      • setPrintFormatter

        public void setPrintFormatter​(DateTimeFormatter dateTimeFormatter)
      • emptyCopy

        public TimeColumn 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<LocalTime>
        Parameters:
        rowSize - the initial row size
        Returns:
        a Column
      • clear

        public void clear()
        Removes all elements TODO: Make this return this column
        Specified by:
        clear in interface Column<LocalTime>
      • sortAscending

        public void sortAscending()
        Sorts my values in ascending order
        Specified by:
        sortAscending in interface Column<LocalTime>
      • sortDescending

        public void sortDescending()
        Sorts my values in descending order
        Specified by:
        sortDescending in interface Column<LocalTime>
      • summary

        public Table summary()
        Returns a table containing a ColumnType specific summary of the data in this column
        Specified by:
        summary in interface Column<LocalTime>
      • countMissing

        public int countMissing()
        Returns the count of missing values in this column
        Specified by:
        countMissing in interface Column<LocalTime>
        Returns:
        missing values as int
      • countUnique

        public int countUnique()
        Returns the count of unique values in this column.
        Specified by:
        countUnique in interface Column<LocalTime>
        Returns:
        unique values as int
      • isEmpty

        public boolean isEmpty()
        Returns true if the column has no data
        Specified by:
        isEmpty in interface Column<LocalTime>
        Returns:
        true if empty, false if not
      • appendCell

        public TimeColumn appendCell​(String object)
        Add one element to the bottom of this column and set its value to the parsed value of the given String. Parsing is type-specific
        Specified by:
        appendCell in interface Column<LocalTime>
      • getPackedTime

        protected int getPackedTime​(int index)
      • rowComparator

        public it.unimi.dsi.fastutil.ints.IntComparator rowComparator()
        Returns an IntComparator for sorting my rows
        Specified by:
        rowComparator in interface Column<LocalTime>
      • getDouble

        public double getDouble​(int i)
      • asDoubleArray

        public double[] asDoubleArray()
      • append

        public TimeColumn append​(Column<LocalTime> column,
                                 int row)
        Appends the value at the given row in the given column to the bottom of this column and return this column
        Specified by:
        append in interface Column<LocalTime>
      • set

        public TimeColumn set​(int row,
                              Column<LocalTime> column,
                              int sourceRow)
        Sets the value at row to the value at sourceRow in the given column and return this column
        Specified by:
        set in interface Column<LocalTime>
      • top

        public List<LocalTime> top​(int n)
        Returns the largest ("top") n values in the column. Does not change the order in this column
        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 List<LocalTime> bottom​(int n)
        Returns the smallest ("bottom") n values in the column, Does not change the order in this column
        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
      • set

        public TimeColumn set​(int index,
                              int value)
      • set

        public TimeColumn set​(Selection rowSelection,
                              LocalTime newValue)
        Conditionally update this column, replacing current values with newValue for all rows where the current value matches the selection criteria

        Example: myColumn.set(myColumn.valueIsMissing(), LocalTime.now()); // no more missing values

        Specified by:
        set in interface Column<LocalTime>
        Overrides:
        set in class AbstractColumn<TimeColumn,​LocalTime>
      • intIterator

        public it.unimi.dsi.fastutil.ints.IntIterator intIterator()
      • contains

        public boolean contains​(LocalTime time)
        Returns true if the given object appears in this column, and false otherwise

        TODO override in column subtypes for performance

        Specified by:
        contains in interface Column<LocalTime>
      • asSet

        public Set<LocalTime> asSet()
        Description copied from interface: Column
        Returns a Set containing all the unique values in this column
        Specified by:
        asSet in interface Column<LocalTime>
      • setMissing

        public TimeColumn setMissing​(int i)
        Sets the value at index i to the missing-value indicator for this column type, and return this column
        Specified by:
        setMissing in interface Column<LocalTime>
      • isMissing

        public Selection isMissing()
        Returns a selection containing an index for every missing value in this column
        Specified by:
        isMissing in interface Column<LocalTime>
      • isNotMissing

        public Selection isNotMissing()
        Returns a selection containing an index for every non-missing value in this column
        Specified by:
        isNotMissing in interface Column<LocalTime>
      • byteSize

        public int byteSize()
        Returns the width of a cell in this column, in bytes.
        Specified by:
        byteSize in interface Column<LocalTime>
        Returns:
        width in bytes
      • asBytes

        public byte[] asBytes​(int rowNumber)
        Returns the contents of the cell at rowNumber as a byte[]
        Specified by:
        asBytes in interface Column<LocalTime>
        Parameters:
        rowNumber - index of the row
        Returns:
        content as byte[]
      • asObjectArray

        public LocalTime[] asObjectArray()
        Description copied from interface: Column
        Returns an array of objects as appropriate for my type of column
        Specified by:
        asObjectArray in interface Column<LocalTime>