public class DateTimeColumn extends AbstractColumn<DateTimeColumn,LocalDateTime> implements DateTimeMapFunctions, DateTimeFilters, TemporalFillers<LocalDateTime,DateTimeColumn>, CategoricalColumn<LocalDateTime>
DEFAULT_ARRAY_SIZE
Modifier and Type | Method and Description |
---|---|
DateTimeColumn |
append(Column<LocalDateTime> column) |
DateTimeColumn |
append(Column<LocalDateTime> column,
int row) |
DateTimeColumn |
append(LocalDateTime dateTime) |
DateTimeColumn |
appendCell(String stringValue) |
DateTimeColumn |
appendCell(String stringValue,
AbstractColumnParser<?> parser) |
DateTimeColumn |
appendInternal(long dateTime) |
DateTimeColumn |
appendMissing()
Appends a missing value appropriate to the column
|
DateTimeColumn |
appendObj(Object obj) |
byte[] |
asBytes(int rowNumber)
Returns the contents of the cell at rowNumber as a byte[]
|
double[] |
asDoubleArray() |
DoubleColumn |
asDoubleColumn() |
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)
Returns an array where each entry is the difference, measured in milliseconds, between the
LocalDateTime and midnight, January 1, 1970 UTC.
|
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)
Returns the seconds from epoch for each value as an array based on the given offset
|
InstantColumn |
asInstantColumn() |
InstantColumn |
asInstantColumn(ZoneId zone) |
LocalDateTime[] |
asObjectArray() |
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() |
int |
compare(LocalDateTime o1,
LocalDateTime o2) |
boolean |
contains(LocalDateTime dateTime)
Returns
true if the given object appears in this column, and false otherwise |
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.
|
static DateTimeColumn |
create(String name) |
static DateTimeColumn |
create(String name,
int initialSize) |
static DateTimeColumn |
create(String name,
List<LocalDateTime> data) |
static DateTimeColumn |
create(String name,
LocalDateTime[] data) |
static DateTimeColumn |
create(String name,
Stream<LocalDateTime> stream) |
it.unimi.dsi.fastutil.longs.LongArrayList |
data()
Deprecated.
Please use the longIterator() or getLongInternal() methods
|
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.
|
DateTimeColumn |
fillWith(Iterable<LocalDateTime> iterable) |
DateTimeColumn |
fillWith(Iterator<LocalDateTime> iterator) |
DateTimeColumn |
fillWith(Supplier<LocalDateTime> supplier) |
LocalDateTime |
get(int index) |
double |
getDouble(int i) |
long |
getLongInternal(int index) |
protected long |
getPackedDateTime(int index) |
String |
getString(int row)
Returns a string representation of the value at the given row.
|
String |
getUnformattedString(int row) |
boolean |
isEmpty()
Returns true if the column has no data
|
boolean |
isMissing(int rowNumber) |
Iterator<LocalDateTime> |
iterator()
Returns an iterator over elements of type
T . |
DateTimeColumn |
lag(int n)
Returns a column of the same type and size as the receiver, containing the receivers values
offset by n.
|
it.unimi.dsi.fastutil.longs.LongIterator |
longIterator() |
LocalDateTime |
max() |
LocalDateTime |
min() |
DateTimeColumn |
plus(long amountToAdd,
ChronoUnit unit) |
DateTimeColumn |
removeMissing() |
it.unimi.dsi.fastutil.ints.IntComparator |
rowComparator() |
DateTimeColumn |
set(int row,
Column<LocalDateTime> column,
int sourceRow) |
DateTimeColumn |
set(int index,
LocalDateTime value) |
DateTimeColumn |
set(int index,
long value) |
DateTimeColumn |
set(Selection rowSelection,
LocalDateTime newValue)
Conditionally update this column, replacing current values with newValue for all rows where the
current value matches the selection criteria
|
Column<LocalDateTime> |
setMissing(int i) |
void |
setPrintFormatter(DateTimeColumnFormatter formatter) |
void |
setPrintFormatter(DateTimeFormatter dateTimeFormatter) |
void |
setPrintFormatter(DateTimeFormatter dateTimeFormatter,
String missingValueString) |
int |
size() |
void |
sortAscending() |
void |
sortDescending() |
DateTimeColumn |
subset(int[] rows) |
Table |
summary() |
List<LocalDateTime> |
top(int n)
Returns the largest ("top") n values in the column
|
DateTimeColumn |
unique()
Returns a column of the same type as the receiver, containing only the unique values of the
receiver.
|
static boolean |
valueIsMissing(long value) |
DateTimeColumn |
where(Selection selection) |
asStringColumn, filter, first, inRange, last, map, max, min, name, sampleN, sampleX, set, setName, sorted, toString, type
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
date, dayOfMonth, dayOfWeek, dayOfWeekValue, dayOfYear, hour, hourMinute, lead, minute, minuteOfDay, month, monthValue, plusDays, plusHours, plusMicros, plusMillis, plusMinutes, plusMonths, plusSeconds, plusWeeks, plusYears, secondOfDay, time, timeWindow, timeWindow, year, yearDay, yearMonth, yearQuarter, yearWeek
difference, differenceInDays, differenceInHours, differenceInMilliseconds, differenceInMinutes, differenceInSeconds, differenceInYears, missingValues, temporalColumnName
allMatch, anyMatch, asList, asStringColumn, columnWidth, count, count, filter, first, inRange, interpolate, isMissing, isNotMissing, last, map, map, mapInto, max, max, min, min, name, noneMatch, print, reduce, reduce, rolling, sampleN, sampleX, set, set, setMissingTo, setName, sorted, title, type
forEach, spliterator
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
isAfter, isAfter, isAfter, isAfterNoon, isBefore, isBefore, isBefore, isBeforeNoon, isBetweenExcluding, isBetweenIncluding, isEqualTo, isEqualTo, isFirstDayOfMonth, isFriday, isInApril, isInAugust, isInDecember, isInFebruary, isInJanuary, isInJuly, isInJune, isInMarch, isInMay, isInNovember, isInOctober, isInQ1, isInQ2, isInQ3, isInQ4, isInSeptember, isInYear, isLastDayOfMonth, isMidnight, isMissing, isMonday, isNoon, isNotEqualTo, isNotEqualTo, isNotMissing, isOnOrAfter, isOnOrAfter, isOnOrAfter, isOnOrBefore, isOnOrBefore, isOnOrBefore, isSaturday, isSunday, isThursday, isTuesday, isWednesday
eval, eval, eval, eval, eval, isAfter, isBefore, isBetweenExcluding, isBetweenIncluding, isEqualTo
countByCategory
public static DateTimeColumn create(String name)
public static DateTimeColumn create(String name, int initialSize)
public static DateTimeColumn create(String name, List<LocalDateTime> data)
public static DateTimeColumn create(String name, Stream<LocalDateTime> stream)
public DateTimeColumn plus(long amountToAdd, ChronoUnit unit)
plus
in interface DateTimeMapFunctions
plus
in interface TemporalMapFunctions<LocalDateTime>
public static DateTimeColumn create(String name, LocalDateTime[] data)
public static boolean valueIsMissing(long value)
public boolean isMissing(int rowNumber)
isMissing
in interface Column<LocalDateTime>
public DateTimeColumn subset(int[] rows)
subset
in interface Column<LocalDateTime>
subset
in class AbstractColumn<DateTimeColumn,LocalDateTime>
public DateTimeColumn removeMissing()
removeMissing
in interface Column<LocalDateTime>
public boolean contains(LocalDateTime dateTime)
Column
true
if the given object appears in this column, and false otherwise
TODO override in column subtypes for performance
contains
in interface Column<LocalDateTime>
public Column<LocalDateTime> setMissing(int i)
setMissing
in interface Column<LocalDateTime>
public DateTimeColumn where(Selection selection)
where
in interface Column<LocalDateTime>
public void setPrintFormatter(DateTimeFormatter dateTimeFormatter, String missingValueString)
public void setPrintFormatter(DateTimeFormatter dateTimeFormatter)
public void setPrintFormatter(DateTimeColumnFormatter formatter)
public DateTimeColumn 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<LocalDateTime>
lag
in interface DateTimeMapFunctions
public DateTimeColumn appendCell(String stringValue)
appendCell
in interface Column<LocalDateTime>
public DateTimeColumn appendCell(String stringValue, AbstractColumnParser<?> parser)
appendCell
in interface Column<LocalDateTime>
public DateTimeColumn append(LocalDateTime dateTime)
append
in interface Column<LocalDateTime>
public DateTimeColumn appendObj(Object obj)
appendObj
in interface Column<LocalDateTime>
public int size()
size
in interface Column<LocalDateTime>
size
in interface TemporalFilters<LocalDateTime>
@Deprecated public it.unimi.dsi.fastutil.longs.LongArrayList data()
public DateTimeColumn appendInternal(long dateTime)
appendInternal
in interface TemporalColumn<LocalDateTime>
public String getString(int row)
Column
getString
in interface Column<LocalDateTime>
row
- The index of the row.public String getUnformattedString(int row)
getUnformattedString
in interface Column<LocalDateTime>
public DateTimeColumn emptyCopy()
Column
emptyCopy
in interface Column<LocalDateTime>
emptyCopy
in interface TemporalMapFunctions<LocalDateTime>
emptyCopy
in class AbstractColumn<DateTimeColumn,LocalDateTime>
Column
public DateTimeColumn emptyCopy(int rowSize)
Column
emptyCopy
in interface Column<LocalDateTime>
rowSize
- the initial row sizeColumn
public DateTimeColumn copy()
Column
copy
in interface Column<LocalDateTime>
Column
public void clear()
clear
in interface Column<LocalDateTime>
public void sortAscending()
sortAscending
in interface Column<LocalDateTime>
public void sortDescending()
sortDescending
in interface Column<LocalDateTime>
public Table summary()
summary
in interface Column<LocalDateTime>
public int countUnique()
Column
countUnique
in interface Column<LocalDateTime>
public DateTimeColumn unique()
Column
unique
in interface Column<LocalDateTime>
Column
public boolean isEmpty()
Column
isEmpty
in interface Column<LocalDateTime>
public long getLongInternal(int index)
getLongInternal
in interface TemporalColumn<LocalDateTime>
getLongInternal
in interface TemporalFilters<LocalDateTime>
protected long getPackedDateTime(int index)
public LocalDateTime get(int index)
get
in interface Column<LocalDateTime>
get
in interface TemporalColumn<LocalDateTime>
get
in interface TemporalFilters<LocalDateTime>
public it.unimi.dsi.fastutil.ints.IntComparator rowComparator()
rowComparator
in interface Column<LocalDateTime>
public DateTimeColumn set(Selection rowSelection, LocalDateTime newValue)
Example: myColumn.set(myColumn.valueIsMissing(), LocalDateTime.now()); // no more missing values
set
in interface Column<LocalDateTime>
set
in class AbstractColumn<DateTimeColumn,LocalDateTime>
public int countMissing()
countMissing
in interface Column<LocalDateTime>
public long[] asEpochSecondArray()
If a value is missing, DateTimeColumnType.missingValueIndicator() is used
public long[] asEpochSecondArray(ZoneOffset offset)
If a value is missing, DateTimeColumnType.missingValueIndicator() is used
public long[] asEpochMillisArray()
If a missing value is encountered, DateTimeColumnType.missingValueIndicator() is inserted in the array
public long[] asEpochMillisArray(ZoneOffset offset)
If a missing value is encountered, DateTimeColumnType.missingValueIndicator() is inserted in the array
public InstantColumn asInstantColumn()
public InstantColumn asInstantColumn(ZoneId zone)
public DateTimeColumn append(Column<LocalDateTime> column)
append
in interface Column<LocalDateTime>
public DateTimeColumn append(Column<LocalDateTime> column, int row)
append
in interface Column<LocalDateTime>
public DateTimeColumn set(int row, Column<LocalDateTime> column, int sourceRow)
set
in interface Column<LocalDateTime>
public LocalDateTime max()
public DateTimeColumn appendMissing()
Column
appendMissing
in interface Column<LocalDateTime>
public LocalDateTime min()
min
in interface TemporalMapFunctions<LocalDateTime>
public DateTimeColumn set(int index, long value)
public DateTimeColumn set(int index, LocalDateTime value)
set
in interface Column<LocalDateTime>
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 int byteSize()
Column
byteSize
in interface Column<LocalDateTime>
public byte[] asBytes(int rowNumber)
asBytes
in interface Column<LocalDateTime>
rowNumber
- index of the rowpublic double getDouble(int i)
public double[] asDoubleArray()
public DoubleColumn asDoubleColumn()
public Iterator<LocalDateTime> iterator()
T
.iterator
in interface Iterable<LocalDateTime>
public DateTimeColumn fillWith(Iterator<LocalDateTime> iterator)
fillWith
in interface TemporalFillers<LocalDateTime,DateTimeColumn>
public DateTimeColumn fillWith(Iterable<LocalDateTime> iterable)
fillWith
in interface TemporalFillers<LocalDateTime,DateTimeColumn>
public DateTimeColumn fillWith(Supplier<LocalDateTime> supplier)
fillWith
in interface TemporalFillers<LocalDateTime,DateTimeColumn>
public LocalDateTime[] asObjectArray()
asObjectArray
in interface Column<LocalDateTime>
public int compare(LocalDateTime o1, LocalDateTime o2)
compare
in interface Comparator<LocalDateTime>
Copyright © 2020. All rights reserved.