Iterable<LocalDate>
, Comparator<LocalDate>
, CategoricalColumn<LocalDate>
, Column<LocalDate>
, DateFillers<DateColumn>
, DateFilters
, DateMapFunctions
, DateAndDateTimeFilterSpec<LocalDate>
, FilterSpec<LocalDate>
public class DateColumn extends AbstractColumn<DateColumn,LocalDate> implements DateFilters, DateFillers<DateColumn>, DateMapFunctions, CategoricalColumn<LocalDate>
Modifier and Type | Field | Description |
---|---|---|
protected it.unimi.dsi.fastutil.ints.IntArrayList |
data |
The data held in this column in its integer encoding form.
|
DEFAULT_ARRAY_SIZE
Modifier and Type | Method | Description |
---|---|---|
DateColumn |
append(LocalDate value) |
Appends value to the bottom of this column and return this column
|
DateColumn |
append(Column<LocalDate> column) |
Appends all the values in the argument to the bottom of this column and return this column
|
DateColumn |
append(Column<LocalDate> column,
int row) |
Appends the value at the given row in the given column to the bottom of this column and return
this column
|
DateColumn |
appendCell(String string) |
Add one element to the bottom of this column and set its value to the parsed value of the given
String.
|
DateColumn |
appendCell(String string,
AbstractColumnParser<?> parser) |
Add one element to the bottom of this column and set its value to the parsed value of the given
String, as performed by the given parser
|
DateColumn |
appendInternal(int f) |
|
DateColumn |
appendMissing() |
Appends a missing value appropriate to the column
|
DateColumn |
appendObj(Object obj) |
Appends the given value to the bottom of this column and return this column
|
byte[] |
asBytes(int rowNumber) |
Returns the contents of the cell at rowNumber as a byte[]
|
double[] |
asDoubleArray() |
|
DoubleColumn |
asDoubleColumn() |
|
List<LocalDate> |
asList() |
Returns a list of all the elements in this column
|
LocalDate[] |
asObjectArray() |
Returns an array of objects as appropriate for my type of column
|
Set<LocalDate> |
asSet() |
Returns a Set containing all the unique values in this column
|
List<LocalDate> |
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() |
Removes all elements TODO: Make this return this column
|
int |
compare(LocalDate o1,
LocalDate o2) |
|
boolean |
contains(LocalDate localDate) |
Returns
true if the given object appears in this column, and false otherwise |
DateColumn |
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 DateColumn |
create(String name) |
Creates a new DateColumn with the given name.
|
static DateColumn |
create(String name,
int initialSize) |
Creates a new DateColumn with the given name.
|
static DateColumn |
create(String name,
LocalDate... data) |
Creates a new DateColumn with the given name and data
|
static DateColumn |
create(String name,
Collection<LocalDate> data) |
Creates a new DateColumn with the given name and data
|
static DateColumn |
create(String name,
Stream<LocalDate> stream) |
Creates a new DateColumn with the given name and data
|
static DateColumn |
createInternal(String name,
int[] data) |
Creates a new DateColumn with the given name and integer-encoded data.
|
DateColumn |
emptyCopy() |
Returns a copy of the receiver with no data.
|
DateColumn |
emptyCopy(int rowSize) |
Returns an empty copy of the receiver, with its internal storage initialized to the given row
size.
|
boolean |
equals(int rowNumber1,
int rowNumber2) |
Returns true if the value in this column at rowNumber1 is equal to the value at rowNumber2
|
DateColumn |
fillWith(Iterable<LocalDate> iterable) |
|
DateColumn |
fillWith(Supplier<LocalDate> supplier) |
|
DateColumn |
fillWith(Iterator<LocalDate> iterator) |
|
LocalDate |
get(int index) |
Returns the value at the given zero-based index
|
double |
getDouble(int i) |
|
int |
getIntInternal(int index) |
|
protected int |
getPackedDate(int index) |
|
String |
getString(int row) |
Returns a string representation of the value at the given row.
|
String |
getUnformattedString(int row) |
Returns a String representation of the value at index r, without any formatting applied
|
it.unimi.dsi.fastutil.ints.IntIterator |
intIterator() |
|
boolean |
isEmpty() |
Returns true if the column has no data
|
boolean |
isMissing(int rowNumber) |
Returns true if the value at rowNumber is missing
|
Iterator<LocalDate> |
iterator() |
Returns an iterator over elements of type
T . |
DateColumn |
lag(int n) |
Returns a column of the same type and size as the receiver, containing the receivers values
offset by n.
|
DateColumn |
lead(int n) |
Returns a column of the same type as the receiver, containing the receivers values offset -n
For example if you lead a column containing 2, 3, 4 by 1, you get a column containing 3, 4, NA.
|
LocalDate |
max() |
|
LocalDate |
min() |
|
DateColumn |
removeMissing() |
Returns a copy of this column with the missing values removed
|
it.unimi.dsi.fastutil.ints.IntComparator |
rowComparator() |
Returns an IntComparator for sorting my rows
|
DateColumn |
set(int index,
int value) |
|
DateColumn |
set(int index,
LocalDate value) |
Sets the value at index row to the given value and return this column
|
DateColumn |
set(int row,
Column<LocalDate> column,
int sourceRow) |
Sets the value at row to the value at sourceRow in the given column and return this column
|
DateColumn |
set(Selection rowSelection,
LocalDate newValue) |
Conditionally update this column, replacing current values with newValue for all rows where the
current value matches the selection criteria
|
DateColumn |
setMissing(int i) |
Sets the value at index i to the missing-value indicator for this column type, and return this
column
|
void |
setPrintFormatter(DateTimeFormatter dateTimeFormatter) |
Creates and sets a printFormatter based-on the given DateTimeFormatter.
|
void |
setPrintFormatter(DateTimeFormatter dateTimeFormatter,
String missingValueString) |
Creates and sets a printFormatter based-on the given DateTimeFormatter.
|
void |
setPrintFormatter(DateColumnFormatter dateColumnFormatter) |
Sets the print formatter to the argument
|
int |
size() |
Returns the number of elements in this column, including missing values
|
void |
sortAscending() |
Sorts my values in ascending order
|
void |
sortDescending() |
Sorts my values in descending order
|
DateColumn |
subset(int[] rows) |
Return a column of the same type containing just those elements whose indexes are included in
the given array
|
Table |
summary() |
Returns a table of dates and the number of observations of those dates
|
List<LocalDate> |
top(int n) |
Returns the largest ("top") n values in the column
|
DateColumn |
unique() |
Returns a column of the same type containing only the unique values
|
int |
valueHash(int rowNumber) |
Returns an int suitable as a hash for the value in this column at the given index
|
static boolean |
valueIsMissing(int i) |
|
DateColumn |
where(Selection selection) |
Returns a new column containing the subset referenced by the
Selection |
asStringColumn, filter, first, indexOf, inRange, last, map, max, min, name, parser, sampleN, sampleX, set, setName, setParser, sorted, toString, type
countByCategory
allMatch, anyMatch, asStringColumn, columnWidth, count, count, filter, first, indexOf, inRange, interpolate, last, map, map, mapInto, max, max, min, min, name, noneMatch, parser, print, reduce, reduce, rolling, sampleN, sampleX, set, set, set, setMissingTo, setName, setParser, sorted, title, type
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
eval, eval, eval, eval, eval, isAfter, isAfter, isAfter, isBefore, isBefore, isBefore, isBetweenExcluding, isBetweenExcluding, isBetweenIncluding, isBetweenIncluding, isEqualTo, isEqualTo, isEqualTo, isFirstDayOfMonth, isFriday, isInApril, isInAugust, isInDecember, isInFebruary, isInJanuary, isInJuly, isInJune, isInMarch, isInMay, isInNovember, isInOctober, isInQ1, isInQ2, isInQ3, isInQ4, isInSeptember, isInYear, isLastDayOfMonth, isMissing, isMonday, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotMissing, isOnOrAfter, isOnOrAfter, isOnOrBefore, isOnOrBefore, isSaturday, isSunday, isThursday, isTuesday, isWednesday
atStartOfDay, atTime, atTime, dateColumnName, dayOfMonth, dayOfWeek, dayOfWeekValue, dayOfYear, daysUntil, minus, minusDays, minusMonths, minusWeeks, minusYears, month, monthsUntil, monthValue, plus, plusDays, plusMonths, plusWeeks, plusYears, timeUntil, timeWindow, timeWindow, weeksUntil, year, yearDay, yearMonth, yearQuarter, yearsUntil, yearWeek
forEach, spliterator
protected it.unimi.dsi.fastutil.ints.IntArrayList data
PackedLocalDate
public static DateColumn create(String name)
public static DateColumn createInternal(String name, int[] data)
PackedLocalDate
for details of the encodingpublic static DateColumn create(String name, int initialSize)
initialSize
missing
values.public static DateColumn create(String name, Collection<LocalDate> data)
public static DateColumn create(String name, LocalDate... data)
public static DateColumn create(String name, Stream<LocalDate> stream)
public int size()
public DateColumn subset(int[] rows)
subset
in interface Column<LocalDate>
subset
in class AbstractColumn<DateColumn,LocalDate>
public DateColumn appendInternal(int f)
public DateColumn set(int index, int value)
public DateColumn set(int index, LocalDate value)
public void setPrintFormatter(DateTimeFormatter dateTimeFormatter, String missingValueString)
public void setPrintFormatter(DateTimeFormatter dateTimeFormatter)
public void setPrintFormatter(@Nonnull DateColumnFormatter dateColumnFormatter)
public String getString(int row)
public String getUnformattedString(int row)
getUnformattedString
in interface Column<LocalDate>
public DateColumn emptyCopy()
emptyCopy
in interface Column<LocalDate>
emptyCopy
in class AbstractColumn<DateColumn,LocalDate>
Column
public DateColumn emptyCopy(int rowSize)
public DateColumn copy()
public void clear()
public DateColumn lead(int n)
public DateColumn lag(int n)
For example if you lag a column containing 2, 3, 4 by 1, you get a column containing NA, 2, 3
public void sortAscending()
sortAscending
in interface Column<LocalDate>
public void sortDescending()
sortDescending
in interface Column<LocalDate>
public int countUnique()
countUnique
in interface Column<LocalDate>
public DateColumn unique()
public DateColumn append(Column<LocalDate> column)
public DateColumn append(Column<LocalDate> column, int row)
public DateColumn set(int row, Column<LocalDate> column, int sourceRow)
public LocalDate max()
max
in interface DateMapFunctions
public LocalDate min()
min
in interface DateMapFunctions
public DateColumn set(Selection rowSelection, LocalDate newValue)
Example: myColumn.set(myColumn.valueIsMissing(), LocalDate.now()); // no more missing values
set
in interface Column<LocalDate>
set
in class AbstractColumn<DateColumn,LocalDate>
public DateColumn appendMissing()
appendMissing
in interface Column<LocalDate>
public LocalDate get(int index)
get
in interface Column<LocalDate>
get
in interface DateMapFunctions
public boolean isEmpty()
public it.unimi.dsi.fastutil.ints.IntComparator rowComparator()
rowComparator
in interface Column<LocalDate>
public DateColumn append(LocalDate value)
public DateColumn appendObj(Object obj)
public DateColumn appendCell(String string)
appendCell
in interface Column<LocalDate>
public DateColumn appendCell(String string, AbstractColumnParser<?> parser)
appendCell
in interface Column<LocalDate>
public int getIntInternal(int index)
getIntInternal
in interface DateFilters
getIntInternal
in interface DateMapFunctions
protected int getPackedDate(int index)
public Table summary()
public static boolean valueIsMissing(int i)
public int countMissing()
countMissing
in interface Column<LocalDate>
public List<LocalDate> 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<LocalDate> 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()
intIterator
in interface DateFilters
public DateColumn removeMissing()
removeMissing
in interface Column<LocalDate>
public List<LocalDate> asList()
Note, if a value in the column is missing, a null
is added in it's place
public DateColumn where(Selection selection)
Selection
where
in interface Column<LocalDate>
where
in interface DateFilters
public boolean contains(LocalDate localDate)
true
if the given object appears in this column, and false otherwise
TODO override in column subtypes for performance
public DateColumn setMissing(int i)
setMissing
in interface Column<LocalDate>
public double[] asDoubleArray()
public DoubleColumn asDoubleColumn()
public boolean isMissing(int rowNumber)
public double getDouble(int i)
public int byteSize()
public int valueHash(int rowNumber)
public boolean equals(int rowNumber1, int rowNumber2)
public byte[] asBytes(int rowNumber)
public DateColumn fillWith(Iterator<LocalDate> iterator)
fillWith
in interface DateFillers<DateColumn>
public DateColumn fillWith(Iterable<LocalDate> iterable)
fillWith
in interface DateFillers<DateColumn>
public DateColumn fillWith(Supplier<LocalDate> supplier)
fillWith
in interface DateFillers<DateColumn>
public LocalDate[] asObjectArray()
asObjectArray
in interface Column<LocalDate>
public int compare(LocalDate o1, LocalDate o2)
compare
in interface Comparator<LocalDate>
Copyright © 2022. All rights reserved.