public class TimeColumn extends AbstractColumn implements CategoricalColumn, Iterable<LocalTime>, TimeFilters, TimeFillers<TimeColumn>, TimeMapFunctions
Modifier and Type | Field and Description |
---|---|
static int |
MISSING_VALUE |
DEFAULT_ARRAY_SIZE
Modifier and Type | Method and Description |
---|---|
void |
append(Column column) |
TimeColumn |
append(LocalTime time) |
TimeColumn |
appendCell(String object) |
TimeColumn |
appendInternal(int f) |
TimeColumn |
appendMissing()
Appends a missing value appropriate to the column
|
byte[] |
asBytes(int rowNumber)
Returns the contents of the cell at rowNumber as a byte[]
|
double[] |
asDoubleArray() |
int[] |
asIntArray() |
List<LocalTime> |
asList()
Returns the entire contents of this column as a list
|
List<LocalTime> |
bottom(int n)
Returns the smallest ("bottom") n values in the column, Does not change the order in this column
|
int |
byteSize()
Returns the width of a cell in this column, in bytes.
|
void |
clear() |
boolean |
contains(LocalTime time) |
int |
convert(String value)
Returns a PackedTime as converted from the given string
|
TimeColumn |
copy()
Returns a deep copy of the receiver
|
int |
countMissing()
Returns the count of missing values in this column
|
int |
countUnique()
Returns the count of unique values in this column.
|
static TimeColumn |
create(String name) |
static TimeColumn |
create(String name,
int initialSize) |
static TimeColumn |
create(String name,
int initialSize,
Locale locale) |
static TimeColumn |
create(String name,
List<LocalTime> data) |
static TimeColumn |
create(String name,
LocalTime[] data) |
it.unimi.dsi.fastutil.ints.IntArrayList |
data() |
TimeColumn |
emptyCopy()
Returns a copy of the receiver with no data.
|
TimeColumn |
emptyCopy(int rowSize)
Returns an empty copy of the receiver, with its internal storage initialized to the given row size.
|
TimeColumn |
fillWith(Iterable<LocalTime> iterable) |
TimeColumn |
fillWith(Iterator<LocalTime> iterator) |
TimeColumn |
fillWith(Supplier<LocalTime> supplier) |
LocalTime |
get(int index) |
double |
getDouble(int i)
Returns a double representation of the value at the given row.
|
int |
getIntInternal(int index)
Returns the packed time representation of the value at index
|
String |
getString(int row)
Returns a string representation of the value at the given row.
|
String |
getUnformattedString(int row) |
it.unimi.dsi.fastutil.ints.IntIterator |
intIterator() |
boolean |
isEmpty()
Returns true if the column has no data
|
Selection |
isMissing() |
boolean |
isMissing(int rowNumber) |
Selection |
isNotMissing() |
Iterator<LocalTime> |
iterator()
Returns an iterator over elements of type
T . |
TimeColumn |
lag(int n)
Returns a column of the same type and size as the receiver, containing the receivers values offset by n.
|
LocalTime |
max() |
LocalTime |
min() |
TimeColumn |
removeMissing() |
it.unimi.dsi.fastutil.ints.IntComparator |
rowComparator() |
TimeColumn |
set(int index,
int value) |
TimeColumn |
set(int index,
LocalTime value) |
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
|
void |
setFormatter(DateTimeFormatter formatter) |
void |
setPrintFormatter(DateTimeFormatter dateTimeFormatter) |
void |
setPrintFormatter(DateTimeFormatter dateTimeFormatter,
String missingValueString) |
int |
size() |
void |
sortAscending() |
void |
sortDescending() |
Table |
summary() |
List<LocalTime> |
top(int n)
Returns the largest ("top") n values in the column.
|
String |
toString() |
ColumnType |
type()
Returns this column's ColumnType
|
TimeColumn |
unique()
Returns a column of the same type as the receiver, containing only the unique values of the receiver.
|
static boolean |
valueIsMissing(int i) |
TimeColumn |
where(Selection selection) |
columnWidth, name, print, setName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
countByCategory
forEach, spliterator
eval, eval, eval, eval, eval, isAfter, isAfter, isAfter, isAfterNoon, isBefore, isBefore, isBefore, isBeforeNoon, isEqualTo, isEqualTo, isMidnight, isNoon, isNotEqualTo, isNotEqualTo, isOnOrAfter, isOnOrAfter, isOnOrBefore, isOnOrBefore
difference, difference, differenceInHours, differenceInMilliseconds, differenceInMinutes, differenceInSeconds, hour, hourMinute, lead, milliseconds, minus, minusHours, minusMilliseconds, minusMinutes, minusSeconds, minute, minuteOfDay, plus, plusHours, plusMilliseconds, plusMinutes, plusSeconds, second, secondOfDay, timeWindow, timeWindow, truncatedTo, with, withHour, withMillisecond, withMinute, withSecond
public void setFormatter(DateTimeFormatter formatter)
public static boolean valueIsMissing(int i)
public static TimeColumn create(String name)
public static TimeColumn create(String name, List<LocalTime> data)
public static TimeColumn create(String name, LocalTime[] data)
public static TimeColumn create(String name, int initialSize)
public static TimeColumn create(String name, int initialSize, Locale locale)
public TimeColumn appendMissing()
Column
appendMissing
in interface Column
public TimeColumn lag(int n)
Column
For example if you lag a column containing 2, 3, 4 by 1, you get a column containing NA, 2, 3
lag
in interface Column
lag
in interface TimeMapFunctions
public TimeColumn appendInternal(int f)
public TimeColumn append(LocalTime time)
public TimeColumn removeMissing()
removeMissing
in interface Column
public ColumnType type()
Column
type
in interface Column
type
in class AbstractColumn
ColumnType
public String getString(int row)
Column
public String getUnformattedString(int row)
getUnformattedString
in interface Column
public void setPrintFormatter(DateTimeFormatter dateTimeFormatter, String missingValueString)
public void setPrintFormatter(DateTimeFormatter dateTimeFormatter)
public TimeColumn emptyCopy()
Column
public TimeColumn emptyCopy(int rowSize)
Column
public TimeColumn copy()
Column
public void sortAscending()
sortAscending
in interface Column
public void sortDescending()
sortDescending
in interface Column
public LocalTime max()
public LocalTime min()
min
in interface TimeMapFunctions
public int countMissing()
countMissing
in interface Column
public int countUnique()
Column
countUnique
in interface Column
public TimeColumn unique()
Column
public boolean isEmpty()
Column
public int convert(String value)
value
- A string representation of a timeDateTimeParseException
- if no parser can be found for the time format usedpublic TimeColumn appendCell(String object)
appendCell
in interface Column
appendCell
in class AbstractColumn
public int getIntInternal(int index)
TimeFilters
getIntInternal
in interface TimeFilters
getIntInternal
in interface TimeMapFunctions
public LocalTime get(int index)
get
in interface TimeFilters
get
in interface TimeMapFunctions
public it.unimi.dsi.fastutil.ints.IntComparator rowComparator()
rowComparator
in interface Column
public it.unimi.dsi.fastutil.ints.IntArrayList data()
data
in interface TimeFilters
public double getDouble(int i)
Column
public double[] asDoubleArray()
asDoubleArray
in interface Column
public String toString()
toString
in class AbstractColumn
public List<LocalTime> top(int n)
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 columnpublic List<LocalTime> bottom(int n)
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 columnpublic TimeColumn set(int index, int value)
public TimeColumn set(int index, LocalTime value)
public TimeColumn set(Selection rowSelection, LocalTime newValue)
Example: myColumn.set(myColumn.valueIsMissing(), LocalTime.now()); // no more missing values
public it.unimi.dsi.fastutil.ints.IntIterator intIterator()
public boolean contains(LocalTime time)
public Selection isNotMissing()
isNotMissing
in interface Column
public int byteSize()
Column
public byte[] asBytes(int rowNumber)
public TimeColumn where(Selection selection)
where
in interface Column
where
in interface TimeFilters
public TimeColumn fillWith(Iterator<LocalTime> iterator)
fillWith
in interface TimeFillers<TimeColumn>
public TimeColumn fillWith(Iterable<LocalTime> iterable)
fillWith
in interface TimeFillers<TimeColumn>
public TimeColumn fillWith(Supplier<LocalTime> supplier)
fillWith
in interface TimeFillers<TimeColumn>
public int[] asIntArray()
asIntArray
in interface CategoricalColumn
Copyright © 2018. All rights reserved.