public class TimeColumn extends AbstractColumn implements Iterable<LocalTime>, TimeMapUtils
Modifier and Type | Field and Description |
---|---|
static int |
MISSING_VALUE |
isEqualTo, isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualTo, isMissing, isNotMissing
Constructor and Description |
---|
TimeColumn(ColumnMetadata metadata) |
TimeColumn(String name) |
TimeColumn(String name,
int initialSize) |
TimeColumn(String name,
List<LocalTime> data) |
Modifier and Type | Method and Description |
---|---|
void |
append(Column column) |
void |
append(LocalTime f) |
void |
appendCell(String object) |
void |
appendInternal(int f) |
byte[] |
asBytes(int rowNumber)
Returns the contents of the cell at rowNumber as a byte[]
|
List<LocalTime> |
bottom(int n)
Returns the smallest ("bottom") n values in the 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.
|
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.
|
LocalTime |
get(int index) |
int |
getIntInternal(int index) |
String |
getString(int row)
Returns a string representation of the value at the given row.
|
it.unimi.dsi.fastutil.ints.IntIterator |
intIterator() |
Selection |
isAfter(int packedTime) |
Selection |
isAfter(LocalTime time) |
Selection |
isAfterNoon()
Applies a function to every value in this column that returns true if the time is in the PM or "after noon".
|
Selection |
isBefore(int packedTime) |
Selection |
isBefore(LocalTime time) |
Selection |
isBeforeNoon()
Applies a function to every value in this column that returns true if the time is in the AM or "before noon".
|
boolean |
isEmpty()
Returns true if the column has no data
|
Selection |
isEqualTo(LocalTime value) |
Selection |
isEqualTo(TimeColumn column)
Returns a bitmap flagging the records for which the value in this column is equal to the value in the given
column
Columnwise isEqualTo.
|
Selection |
isMidnight() |
Selection |
isMissing() |
Selection |
isNoon() |
Selection |
isNotEqualTo(LocalTime value) |
Selection |
isNotMissing() |
Selection |
isOnOrAfter(int packed) |
Selection |
isOnOrAfter(LocalTime time) |
Selection |
isOnOrBefore(int packed) |
Selection |
isOnOrBefore(LocalTime value) |
Iterator<LocalTime> |
iterator()
Returns an iterator over elements of type
T . |
LocalTime |
max() |
LocalTime |
min() |
String |
print() |
it.unimi.dsi.fastutil.ints.IntComparator |
rowComparator() |
Selection |
select(IntBiPredicate predicate,
int value) |
Selection |
select(IntPredicate predicate) |
TimeColumn |
selectIf(IntPredicate predicate)
This version operates on predicates that treat the given IntPredicate as operating on a packed local time
This is much more efficient that using a LocalTimePredicate, but requires that the developer understand the
semantics of packedLocalTimes
|
TimeColumn |
selectIf(LocalTimePredicate predicate) |
void |
set(int index,
int value) |
void |
set(LocalTime newValue,
Selection rowSelection)
Conditionally update this column, replacing current values with newValue for all rows where the current value
matches the selection criteria
Example:
myColumn.set(LocalTime.now(), myColumn.isMissing()); // no more missing values
|
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.
|
columnMetadata, columnWidth, comment, difference, id, metadata, name, setComment, setName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
difference, difference, differenceInHours, differenceInMilliseconds, differenceInMinutes, differenceInSeconds, hour, minuteOfDay, secondOfDay
asDoubleArray, columnMetadata, columnWidth, comment, difference, first, first, id, last, last, metadata, name, rolling, setComment, setName, subset, title
forEach, spliterator
public TimeColumn(String name)
public TimeColumn(ColumnMetadata metadata)
public TimeColumn(String name, int initialSize)
public void appendInternal(int f)
public void append(LocalTime f)
public ColumnType type()
Column
type
in interface Column
ColumnType
public String getString(int row)
Column
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()
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 void appendCell(String object)
appendCell
in interface Column
appendCell
in class AbstractColumn
public int getIntInternal(int index)
getIntInternal
in interface TimeMapUtils
public LocalTime get(int index)
get
in interface TimeMapUtils
public it.unimi.dsi.fastutil.ints.IntComparator rowComparator()
rowComparator
in interface Column
public it.unimi.dsi.fastutil.ints.IntArrayList data()
data
in interface TimeColumnUtils
public TimeColumn selectIf(LocalTimePredicate predicate)
public TimeColumn selectIf(IntPredicate predicate)
public Selection isMidnight()
public Selection isNoon()
public Selection isBefore(int packedTime)
public Selection isAfter(int packedTime)
public Selection isOnOrAfter(int packed)
public Selection isOnOrBefore(int packed)
public Selection isBeforeNoon()
public Selection isAfterNoon()
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 void set(int index, int value)
public void set(LocalTime newValue, Selection rowSelection)
public Selection isEqualTo(TimeColumn column)
public it.unimi.dsi.fastutil.ints.IntIterator intIterator()
public Selection select(IntPredicate predicate)
public Selection select(IntBiPredicate predicate, int value)
public boolean contains(LocalTime time)
public Selection isNotMissing()
isNotMissing
in interface Column
public int byteSize()
Column
public byte[] asBytes(int rowNumber)
Copyright © 2018. All rights reserved.