public class DateTimeColumn extends AbstractColumn implements DateTimeMapUtils, Iterable<LocalDateTime>
Modifier and Type | Field and Description |
---|---|
static long |
MISSING_VALUE |
isMissing, isNotMissing
Constructor and Description |
---|
DateTimeColumn(ColumnMetadata metadata) |
DateTimeColumn(String name) |
DateTimeColumn(String name,
int initialSize) |
DateTimeColumn(String name,
List<LocalDateTime> data) |
Modifier and Type | Method and Description |
---|---|
void |
add(LocalDateTime dateTime) |
void |
append(Column column) |
void |
append(LocalDateTime dateTime) |
void |
appendCell(String stringValue) |
void |
appendInternal(long dateTime) |
byte[] |
asBytes(int rowNumber)
Returns the contents of the cell at rowNumber as a byte[]
|
long[] |
asEpochMillisArray()
Returns an array where each entry is the difference, measured in milliseconds,
between the LocalDateTime and midnight, January 1, 1970 UTC.
|
long[] |
asEpochMillisArray(ZoneOffset offset) |
long[] |
asEpochSecondArray()
Returns an array where each entry is the difference, measured in seconds,
between the LocalDateTime and midnight, January 1, 1970 UTC.
|
long[] |
asEpochSecondArray(ZoneOffset offset) |
Set<LocalDateTime> |
asSet() |
List<LocalDateTime> |
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(LocalDateTime dateTime) |
long |
convert(String value)
Returns a PackedDateTime as converted from the given string
|
DateTimeColumn |
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.longs.LongArrayList |
data() |
DateColumn |
date()
Returns a DateColumn containing the date portion of each dateTime in this DateTimeColumn
|
ShortColumn |
dayOfMonth() |
CategoryColumn |
dayOfWeek() |
ShortColumn |
dayOfWeekValue() |
ShortColumn |
dayOfYear() |
DateTimeColumn |
difference()
Returns a new column of the same type as the receiver, such that the values in the new column
contain the difference between each cell in the original and it's predecessor.
|
DateTimeColumn |
emptyCopy()
Returns a copy of the receiver with no data.
|
DateTimeColumn |
emptyCopy(int rowSize)
Returns an empty copy of the receiver, with its internal storage initialized to the given row size.
|
LocalDateTime |
get(int index) |
long |
getLongInternal(int index) |
String |
getString(int row)
Returns a string representation of the value at the given row.
|
Selection |
isAfter(DateTimeColumn column) |
Selection |
isAfter(LocalDateTime value) |
Selection |
isAfter(Long packedDateTime) |
Selection |
isAfterNoon() |
Selection |
isBefore(DateTimeColumn column) |
Selection |
isBefore(LocalDateTime value) |
Selection |
isBefore(Long packedDateTime) |
Selection |
isBeforeNoon() |
boolean |
isEmpty()
Returns true if the column has no data
|
Selection |
isEqualTo(DateTimeColumn column) |
Selection |
isEqualTo(LocalDateTime value) |
Selection |
isFirstDayOfMonth() |
Selection |
isFriday() |
Selection |
isInApril() |
Selection |
isInAugust() |
Selection |
isInDecember() |
Selection |
isInFebruary() |
Selection |
isInJanuary() |
Selection |
isInJuly() |
Selection |
isInJune() |
Selection |
isInMarch() |
Selection |
isInMay() |
Selection |
isInNovember() |
Selection |
isInOctober() |
Selection |
isInQ1() |
Selection |
isInQ2() |
Selection |
isInQ3() |
Selection |
isInQ4() |
Selection |
isInSeptember() |
Selection |
isInYear(int year) |
Selection |
isLastDayOfMonth() |
Selection |
isMidnight() |
Selection |
isMissing() |
Selection |
isMonday() |
Selection |
isNoon() |
Selection |
isNotMissing() |
Selection |
isOnOrAfter(LocalDateTime value) |
Selection |
isOnOrAfter(long value) |
Selection |
isOnOrBefore(LocalDateTime value) |
Selection |
isOnOrBefore(long value) |
Selection |
isSaturday() |
Selection |
isSunday() |
Selection |
isThursday() |
Selection |
isTuesday() |
Selection |
isWednesday() |
Iterator<LocalDateTime> |
iterator()
Returns an iterator over elements of type
T . |
it.unimi.dsi.fastutil.longs.LongIterator |
longIterator() |
LocalDateTime |
max() |
LocalDateTime |
min() |
ShortColumn |
minuteOfDay() |
CategoryColumn |
monthName() |
ShortColumn |
monthNumber() |
String |
print() |
it.unimi.dsi.fastutil.ints.IntComparator |
rowComparator() |
Selection |
select(LongBiPredicate predicate,
long value) |
Selection |
select(LongPredicate predicate) |
DateTimeColumn |
selectIf(LocalDateTimePredicate predicate) |
DateTimeColumn |
selectIf(LongPredicate predicate) |
void |
set(int index,
LocalDateTime value) |
void |
set(int index,
long value) |
void |
set(LocalDateTime 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(LocalDateTime.now(), myColumn.isMissing()); // no more missing values
|
int |
size() |
void |
sortAscending() |
void |
sortDescending() |
Table |
summary() |
TimeColumn |
time()
Returns a TimeColumn containing the time portion of each dateTime in this DateTimeColumn
|
List<LocalDateTime> |
top(int n)
Returns the largest ("top") n values in the column
|
String |
toString() |
ColumnType |
type()
Returns this column's ColumnType
|
DateTimeColumn |
unique()
Returns a column of the same type as the receiver, containing only the unique values of the receiver.
|
ShortColumn |
year() |
CategoryColumn |
yearDayString()
Returns a CategoryColumn with the year and day-of-year derived from this column concatenated into a String
that will sort lexicographically in temporal order.
|
CategoryColumn |
yearMonthString()
Returns a CategoryColumn with the year and month from this column concatenated into a String that will sort
lexicographically in temporal order.
|
CategoryColumn |
yearWeekString()
Returns a CategoryColumn with the year and week-of-year derived from this column concatenated into a String
that will sort lexicographically in temporal order.
|
columnMetadata, columnWidth, comment, id, metadata, name, setComment, setName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
difference, difference, differenceInDays, differenceInHours, differenceInMilliseconds, differenceInMinutes, differenceInSeconds, differenceInYears, hour, secondOfDay
asDoubleArray, columnMetadata, columnWidth, comment, first, first, id, last, last, metadata, name, rolling, setComment, setName, subset, title
forEach, spliterator
public static final long MISSING_VALUE
public DateTimeColumn(String name)
public DateTimeColumn(ColumnMetadata metadata)
public DateTimeColumn(String name, int initialSize)
public DateTimeColumn(String name, List<LocalDateTime> data)
public void appendCell(String stringValue)
appendCell
in interface Column
appendCell
in class AbstractColumn
public void add(LocalDateTime dateTime)
public long convert(String value)
value
- A string representation of a timeDateTimeParseException
- if no parser can be found for the time format usedpublic it.unimi.dsi.fastutil.longs.LongArrayList data()
data
in interface DateTimeColumnUtils
public ColumnType type()
Column
type
in interface Column
ColumnType
public void appendInternal(long dateTime)
public void append(LocalDateTime dateTime)
public String getString(int row)
Column
public DateTimeColumn emptyCopy()
Column
public DateTimeColumn emptyCopy(int rowSize)
Column
public DateTimeColumn copy()
Column
public void sortAscending()
sortAscending
in interface Column
public void sortDescending()
sortDescending
in interface Column
public int countUnique()
Column
countUnique
in interface Column
public DateTimeColumn unique()
Column
public boolean isEmpty()
Column
public long getLongInternal(int index)
getLongInternal
in interface DateTimeMapUtils
public LocalDateTime get(int index)
get
in interface DateTimeMapUtils
public it.unimi.dsi.fastutil.ints.IntComparator rowComparator()
rowComparator
in interface Column
public CategoryColumn dayOfWeek()
public ShortColumn dayOfWeekValue()
public ShortColumn dayOfYear()
public ShortColumn dayOfMonth()
public TimeColumn time()
public DateColumn date()
public ShortColumn monthNumber()
public CategoryColumn monthName()
public CategoryColumn yearMonthString()
public CategoryColumn yearDayString()
public CategoryColumn yearWeekString()
public ShortColumn year()
public void set(LocalDateTime newValue, Selection rowSelection)
public Selection isEqualTo(LocalDateTime value)
public Selection isEqualTo(DateTimeColumn column)
public Selection isAfter(LocalDateTime value)
public Selection isOnOrAfter(long value)
public Selection isOnOrAfter(LocalDateTime value)
public Selection isBefore(LocalDateTime value)
public Selection isOnOrBefore(long value)
public Selection isOnOrBefore(LocalDateTime value)
public Selection isAfter(DateTimeColumn column)
public Selection isBefore(DateTimeColumn column)
public int countMissing()
countMissing
in interface Column
public long[] asEpochSecondArray()
public long[] asEpochSecondArray(ZoneOffset offset)
public long[] asEpochMillisArray()
public long[] asEpochMillisArray(ZoneOffset offset)
public Selection isNotMissing()
isNotMissing
in interface Column
public LocalDateTime max()
public LocalDateTime min()
public ShortColumn minuteOfDay()
minuteOfDay
in interface DateTimeMapUtils
public DateTimeColumn selectIf(LocalDateTimePredicate predicate)
public DateTimeColumn selectIf(LongPredicate predicate)
public Selection isMonday()
public Selection isTuesday()
public Selection isWednesday()
public Selection isThursday()
public Selection isFriday()
public Selection isSaturday()
public Selection isSunday()
public Selection isInJanuary()
public Selection isInFebruary()
public Selection isInMarch()
public Selection isInApril()
public Selection isInMay()
public Selection isInJune()
public Selection isInJuly()
public Selection isInAugust()
public Selection isInSeptember()
public Selection isInOctober()
public Selection isInNovember()
public Selection isInDecember()
public Selection isFirstDayOfMonth()
public Selection isLastDayOfMonth()
public Selection isInQ1()
public Selection isInQ2()
public Selection isInQ3()
public Selection isInQ4()
public Selection isNoon()
public Selection isMidnight()
public Selection isBeforeNoon()
public Selection isAfterNoon()
public Selection select(LongPredicate predicate)
public void set(int index, long value)
public void set(int index, LocalDateTime value)
public Selection select(LongBiPredicate predicate, long value)
public List<LocalDateTime> 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<LocalDateTime> 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.longs.LongIterator longIterator()
public Set<LocalDateTime> asSet()
public Selection isInYear(int year)
public boolean contains(LocalDateTime dateTime)
public int byteSize()
Column
public byte[] asBytes(int rowNumber)
public Iterator<LocalDateTime> iterator()
T
.iterator
in interface Iterable<LocalDateTime>
public DateTimeColumn difference()
Column
difference
in interface Column
difference
in class AbstractColumn
Column
Copyright © 2018. All rights reserved.