public class DateTimeColumn extends AbstractColumn implements DateTimeMapFunctions, DateTimeFilters, DateTimeFillers<DateTimeColumn>, Iterable<LocalDateTime>
Modifier and Type | Field and Description |
---|---|
static long |
MISSING_VALUE |
DEFAULT_ARRAY_SIZE
Modifier and Type | Method and Description |
---|---|
void |
append(Column column) |
DateTimeColumn |
append(LocalDateTime dateTime) |
DateTimeColumn |
appendCell(String stringValue) |
DateTimeColumn |
appendInternal(long dateTime) |
DateTimeColumn |
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() |
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.
|
static DateTimeColumn |
create(String name) |
static DateTimeColumn |
create(String name,
int initialSize) |
static DateTimeColumn |
create(String name,
int initialSize,
Locale locale) |
static DateTimeColumn |
create(String name,
List<LocalDateTime> data) |
static DateTimeColumn |
create(String name,
LocalDateTime[] data) |
it.unimi.dsi.fastutil.longs.LongArrayList |
data() |
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)
Returns a double representation of the value at the given row.
|
long |
getLongInternal(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 |
removeMissing() |
it.unimi.dsi.fastutil.ints.IntComparator |
rowComparator() |
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
|
void |
setFormatter(DateTimeFormatter formatter) |
void |
setPrintFormatter(DateTimeColumnFormatter formatter) |
void |
setPrintFormatter(DateTimeFormatter dateTimeFormatter) |
void |
setPrintFormatter(DateTimeFormatter dateTimeFormatter,
String missingValueString) |
int |
size() |
void |
sortAscending() |
void |
sortDescending() |
Table |
summary() |
List<LocalDateTime> |
top(int n)
Returns the largest ("top") n values in the column
|
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.
|
static boolean |
valueIsMissing(long value) |
DateTimeColumn |
where(Selection selection) |
columnWidth, name, print, setName, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
date, dayOfMonth, dayOfWeek, dayOfWeekValue, dayOfYear, difference, difference, differenceInDays, differenceInHours, differenceInMilliseconds, differenceInMinutes, differenceInSeconds, differenceInYears, hour, hourMinute, lead, minute, minuteOfDay, month, monthValue, secondOfDay, time, timeWindow, timeWindow, year, yearDay, yearMonth, yearQuarter, yearWeek
eval, eval, eval, eval, eval, isAfter, isAfter, isAfter, isAfterNoon, isBefore, isBefore, isBefore, isBeforeNoon, isBetweenExcluding, isBetweenExcluding, isBetweenIncluding, 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
columnWidth, create, first, inRange, last, name, print, rolling, rows, sampleN, sampleX, setName, subset, summarizeIf, title
forEach, spliterator
public void setFormatter(DateTimeFormatter formatter)
public static boolean valueIsMissing(long value)
public static DateTimeColumn create(String name)
public static DateTimeColumn create(String name, int initialSize)
public static DateTimeColumn create(String name, int initialSize, Locale locale)
public static DateTimeColumn create(String name, List<LocalDateTime> data)
public static DateTimeColumn create(String name, LocalDateTime[] data)
public DateTimeColumn removeMissing()
removeMissing
in interface Column
public boolean contains(LocalDateTime dateTime)
public DateTimeColumn where(Selection selection)
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
lag
in interface DateTimeMapFunctions
public DateTimeColumn appendCell(String stringValue)
appendCell
in interface Column
appendCell
in class AbstractColumn
public DateTimeColumn append(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 int size()
size
in interface Column
size
in interface DateTimeFilters
public it.unimi.dsi.fastutil.longs.LongArrayList data()
data
in interface DateTimeFilters
public ColumnType type()
Column
type
in interface Column
type
in class AbstractColumn
ColumnType
public DateTimeColumn appendInternal(long dateTime)
public String getString(int row)
Column
public String getUnformattedString(int row)
getUnformattedString
in interface 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 DateTimeFilters
getLongInternal
in interface DateTimeMapFunctions
public LocalDateTime get(int index)
get
in interface DateTimeFilters
get
in interface DateTimeMapFunctions
public it.unimi.dsi.fastutil.ints.IntComparator rowComparator()
rowComparator
in interface Column
public DateTimeColumn set(Selection rowSelection, LocalDateTime newValue)
Example: myColumn.set(myColumn.valueIsMissing(), LocalDateTime.now()); // no more missing values
public int countMissing()
countMissing
in interface Column
public long[] asEpochSecondArray()
public long[] asEpochSecondArray(ZoneOffset offset)
public long[] asEpochMillisArray()
public long[] asEpochMillisArray(ZoneOffset offset)
public LocalDateTime max()
public DateTimeColumn appendMissing()
Column
appendMissing
in interface Column
public LocalDateTime min()
min
in interface DateTimeMapFunctions
public DateTimeColumn set(int index, long value)
public DateTimeColumn set(int index, LocalDateTime 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 int byteSize()
Column
public byte[] asBytes(int rowNumber)
public double getDouble(int i)
Column
public double[] asDoubleArray()
asDoubleArray
in interface Column
public Iterator<LocalDateTime> iterator()
T
.iterator
in interface Iterable<LocalDateTime>
public DateTimeColumn fillWith(Iterator<LocalDateTime> iterator)
fillWith
in interface DateTimeFillers<DateTimeColumn>
public DateTimeColumn fillWith(Iterable<LocalDateTime> iterable)
fillWith
in interface DateTimeFillers<DateTimeColumn>
public DateTimeColumn fillWith(Supplier<LocalDateTime> supplier)
fillWith
in interface DateTimeFillers<DateTimeColumn>
Copyright © 2018. All rights reserved.