public class TimeColumn extends AbstractColumn implements java.lang.Iterable<java.time.LocalTime>, TimeMapUtils
Modifier and Type | Field and Description |
---|---|
static int |
MISSING_VALUE |
isMissing, isNotMissing
Constructor and Description |
---|
TimeColumn(ColumnMetadata metadata) |
TimeColumn(java.lang.String name,
int initialSize) |
Modifier and Type | Method and Description |
---|---|
void |
add(int f) |
void |
addCell(java.lang.String object) |
void |
append(Column column) |
byte[] |
asBytes(int rowNumber)
Returns the contents of the cell at rowNumber as a byte[]
|
java.util.List<java.time.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(java.time.LocalTime time) |
int |
convert(java.lang.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(java.lang.String name) |
static TimeColumn |
create(java.lang.String fileName,
it.unimi.dsi.fastutil.ints.IntArrayList times) |
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
|
java.time.LocalTime |
get(int index) |
int |
getInt(int index) |
java.lang.String |
getString(int row)
Returns a string representation of the value at the given row
|
it.unimi.dsi.fastutil.ints.IntIterator |
intIterator() |
Selection |
isAfter(java.time.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(java.time.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(java.time.LocalTime value) |
Selection |
isMidnight() |
Selection |
isMissing() |
Selection |
isNoon() |
Selection |
isNotEqualTo(java.time.LocalTime value) |
Selection |
isNotMissing() |
java.util.Iterator<java.time.LocalTime> |
iterator()
Returns an iterator over elements of type
T . |
java.time.LocalTime |
max() |
java.time.LocalTime |
min() |
java.lang.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) |
int |
size() |
void |
sortAscending() |
void |
sortDescending() |
Table |
summary() |
java.util.List<java.time.LocalTime> |
top(int n)
Returns the largest ("top") n values in the column
|
java.lang.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
columnMetadata, columnWidth, comment, difference, first, first, id, last, last, metadata, name, setComment, setName, subset, title, toDoubleArray
public TimeColumn(ColumnMetadata metadata)
public TimeColumn(java.lang.String name, int initialSize)
public static TimeColumn create(java.lang.String name)
public static TimeColumn create(java.lang.String fileName, it.unimi.dsi.fastutil.ints.IntArrayList times)
public void add(int f)
public ColumnType type()
Column
public java.lang.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 java.time.LocalTime max()
public java.time.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(java.lang.String value)
value
- A string representation of a timejava.time.format.DateTimeParseException
- if no parser can be found for the time format usedpublic void addCell(java.lang.String object)
addCell
in interface Column
addCell
in class AbstractColumn
public int getInt(int index)
getInt
in interface TimeMapUtils
public java.time.LocalTime get(int index)
get
in interface TimeMapUtils
public it.unimi.dsi.fastutil.ints.IntComparator rowComparator()
rowComparator
in interface Column
public Selection isNotEqualTo(java.time.LocalTime value)
public Selection isEqualTo(java.time.LocalTime value)
public it.unimi.dsi.fastutil.ints.IntArrayList data()
data
in interface TimeColumnUtils
public java.lang.String toString()
toString
in class java.lang.Object
public TimeColumn selectIf(LocalTimePredicate predicate)
public TimeColumn selectIf(IntPredicate predicate)
public Selection isMidnight()
public Selection isNoon()
public Selection isBefore(java.time.LocalTime time)
public Selection isAfter(java.time.LocalTime time)
public Selection isBeforeNoon()
public Selection isAfterNoon()
public java.util.List<java.time.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 java.util.List<java.time.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 it.unimi.dsi.fastutil.ints.IntIterator intIterator()
public Selection select(IntPredicate predicate)
public Selection select(IntBiPredicate predicate, int value)
public boolean contains(java.time.LocalTime time)
public Selection isNotMissing()
isNotMissing
in interface Column
public int byteSize()
Column
public byte[] asBytes(int rowNumber)
public java.util.Iterator<java.time.LocalTime> iterator()
T
.iterator
in interface java.lang.Iterable<java.time.LocalTime>