public class DateColumn extends AbstractColumn<LocalDate> implements DateFilters, DateFillers<DateColumn>, DateMapFunctions, CategoricalColumn<LocalDate>
| Modifier and Type | Field and Description |
|---|---|
static int |
MISSING_VALUE |
DEFAULT_ARRAY_SIZE| Modifier and Type | Method and Description |
|---|---|
DateColumn |
append(Column<LocalDate> column) |
DateColumn |
append(Column<LocalDate> column,
int row) |
DateColumn |
append(LocalDate value) |
DateColumn |
appendCell(String string) |
DateColumn |
appendCell(String string,
AbstractParser<?> parser) |
DateColumn |
appendInternal(int f) |
DateColumn |
appendMissing()
Appends a missing value appropriate to the column
|
DateColumn |
appendObj(Object obj) |
byte[] |
asBytes(int rowNumber)
Returns the contents of the cell at rowNumber as a byte[]
|
double[] |
asDoubleArray() |
List<LocalDate> |
asList()
Returns a list of all the elements in this column
Note, if a value in the column is missing, a
null is added in it's place |
Object[] |
asObjectArray() |
Set<LocalDate> |
asSet() |
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() |
int |
compare(LocalDate o1,
LocalDate o2) |
boolean |
contains(LocalDate localDate)
Returns
true if the given object appears in this column, and false otherwise
TODO override in column subtypes for performance |
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) |
static DateColumn |
create(String name,
int initialSize) |
static DateColumn |
create(String name,
List<LocalDate> data) |
static DateColumn |
create(String name,
LocalDate[] data) |
it.unimi.dsi.fastutil.ints.IntArrayList |
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.
|
DateColumn |
fillWith(Iterable<LocalDate> iterable) |
DateColumn |
fillWith(Iterator<LocalDate> iterator) |
DateColumn |
fillWith(Supplier<LocalDate> supplier) |
DateColumn |
filter(Predicate<? super LocalDate> test)
Returns a new Column of the same type with only those rows satisfying the predicate
|
DateColumn |
first(int numRows) |
LocalDate |
get(int index) |
double |
getDouble(int i) |
int |
getIntInternal(int index) |
String |
getString(int row)
Returns a string representation of the value at the given row.
|
String |
getUnformattedString(int row) |
DateColumn |
inRange(int start,
int end)
Returns a column containing the rows in this column beginning with start inclusive, and ending with end exclusive
|
it.unimi.dsi.fastutil.ints.IntIterator |
intIterator() |
boolean |
isEmpty()
Returns true if the column has no data
|
boolean |
isMissing(int rowNumber) |
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 |
last(int numRows) |
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.
|
DateColumn |
map(Function<? super LocalDate,? extends LocalDate> fun)
Maps the function across all rows, appending the results to a new Column of the same type
|
LocalDate |
max() |
DateColumn |
max(Column<LocalDate> other)
Returns a column containing the element-wise min between this column and other column
TODO(lwhite) Override in column subtypes for better performance
|
LocalDate |
min() |
DateColumn |
min(Column<LocalDate> other)
Returns a column containing the element-wise min between this column and other column
TODO(lwhite) Override in column subtypes for better performance
|
DateColumn |
removeMissing() |
it.unimi.dsi.fastutil.ints.IntComparator |
rowComparator() |
DateColumn |
sampleN(int n)
Returns a column containing a random sample of the values in this column
|
DateColumn |
sampleX(double proportion)
Returns a table consisting of randomly selected values from this column.
|
DateColumn |
set(int row,
Column<LocalDate> column,
int sourceRow) |
DateColumn |
set(int index,
int value) |
DateColumn |
set(int index,
LocalDate value) |
DateColumn |
set(Selection condition,
Column<LocalDate> other)
Updates this column where values matching the selection are replaced with the corresponding value
from the given 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
|
Column<LocalDate> |
setMissing(int i) |
DateColumn |
setName(String name)
Sets the columns name to the given string
|
void |
setPrintFormatter(DateTimeFormatter dateTimeFormatter) |
void |
setPrintFormatter(DateTimeFormatter dateTimeFormatter,
String missingValueString) |
int |
size() |
void |
sortAscending() |
void |
sortDescending() |
DateColumn |
sorted(Comparator<? super LocalDate> comp)
Returns a new Column of the same type sorted according to the provided Comparator
|
DateColumn |
subset(int[] rows) |
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 as the receiver, containing only the unique values of the receiver.
|
static boolean |
valueIsMissing(int i) |
DateColumn |
where(Selection selection) |
name, toString, typeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waiteval, 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, isNotMissing, isOnOrAfter, isOnOrAfter, isOnOrBefore, isOnOrBefore, isSaturday, isSunday, isThursday, isTuesday, isWednesdayatStartOfDay, 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, yearWeekcountByCategoryallMatch, anyMatch, columnWidth, count, count, mapInto, max, min, name, noneMatch, print, reduce, reduce, rolling, title, typeforEach, spliteratorcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic static DateColumn create(String name)
public static DateColumn create(String name, int initialSize)
public static DateColumn create(String name, List<LocalDate> data)
public static DateColumn create(String name, LocalDate[] data)
public DateColumn subset(int[] rows)
public DateColumn appendInternal(int f)
public it.unimi.dsi.fastutil.ints.IntArrayList data()
data in interface DateFilterspublic 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 String getString(int row)
Columnpublic String getUnformattedString(int row)
getUnformattedString in interface Column<LocalDate>public DateColumn emptyCopy()
Columnpublic DateColumn emptyCopy(int rowSize)
Columnpublic DateColumn copy()
Columnpublic DateColumn lead(int n)
Columnpublic DateColumn lag(int n)
ColumnFor 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()
ColumncountUnique in interface Column<LocalDate>public DateColumn unique()
Columnpublic 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 DateMapFunctionspublic LocalDate min()
min in interface DateMapFunctionspublic DateColumn set(Selection rowSelection, LocalDate newValue)
Example: myColumn.set(myColumn.valueIsMissing(), LocalDate.now()); // no more missing values
public DateColumn appendMissing()
ColumnappendMissing in interface Column<LocalDate>public LocalDate get(int index)
get in interface Column<LocalDate>get in interface DateMapFunctionspublic boolean isEmpty()
Columnpublic 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, AbstractParser<?> parser)
appendCell in interface Column<LocalDate>public int getIntInternal(int index)
getIntInternal in interface DateFiltersgetIntInternal in interface DateMapFunctionspublic 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()
public DateColumn removeMissing()
removeMissing in interface Column<LocalDate>public List<LocalDate> asList()
Columnnull is added in it's placepublic DateColumn where(Selection selection)
where in interface Column<LocalDate>where in interface DateFilterspublic boolean contains(LocalDate localDate)
Columntrue if the given object appears in this column, and false otherwise
TODO override in column subtypes for performancepublic Column<LocalDate> setMissing(int i)
setMissing in interface Column<LocalDate>public double[] asDoubleArray()
public boolean isMissing(int rowNumber)
public double getDouble(int i)
public int byteSize()
Columnpublic 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 Object[] asObjectArray()
asObjectArray in interface Column<LocalDate>public int compare(LocalDate o1, LocalDate o2)
compare in interface Comparator<LocalDate>public DateColumn setName(String name)
Columnpublic DateColumn filter(Predicate<? super LocalDate> test)
Columnpublic DateColumn sorted(Comparator<? super LocalDate> comp)
Columnpublic DateColumn map(Function<? super LocalDate,? extends LocalDate> fun)
Columnpublic DateColumn min(Column<LocalDate> other)
Columnpublic DateColumn max(Column<LocalDate> other)
Columnpublic DateColumn set(Selection condition, Column<LocalDate> other)
Columnpublic DateColumn first(int numRows)
public DateColumn last(int numRows)
public DateColumn inRange(int start, int end)
Columnpublic DateColumn sampleN(int n)
Columnpublic DateColumn sampleX(double proportion)
ColumnCopyright © 2018. All rights reserved.