public class DateColumn extends AbstractColumn implements DateMapUtils
| Modifier and Type | Field and Description |
|---|---|
static int |
MISSING_VALUE |
isEqualTo, isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualTo, isMissing, isNotMissing| Constructor and Description |
|---|
DateColumn(ColumnMetadata metadata) |
DateColumn(ColumnMetadata metadata,
Locale locale) |
DateColumn(String name) |
DateColumn(String name,
int initialSize) |
DateColumn(String name,
List<LocalDate> data) |
DateColumn(String name,
Locale locale) |
| Modifier and Type | Method and Description |
|---|---|
void |
append(Column column) |
void |
append(LocalDate f) |
void |
appendCell(String string) |
void |
appendInternal(int f) |
byte[] |
asBytes(int rowNumber)
Returns the contents of the cell at rowNumber as a byte[]
|
List<LocalDate> |
asList() |
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() |
boolean |
contains(LocalDate localDate) |
int |
convert(String value)
Returns a PackedDate as converted from the given string
|
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.
|
it.unimi.dsi.fastutil.ints.IntArrayList |
data() |
ShortColumn |
dayOfMonth() |
CategoryColumn |
dayOfWeek() |
ShortColumn |
dayOfWeekValue() |
ShortColumn |
dayOfYear() |
DateColumn |
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.
|
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.
|
LocalDate |
firstElement() |
LocalDate |
get(int index) |
int |
getIntInternal(int index) |
String |
getString(int row)
Returns a string representation of the value at the given row.
|
it.unimi.dsi.fastutil.ints.IntIterator |
intIterator() |
Selection |
isAfter(int value) |
Selection |
isAfter(LocalDate value) |
Selection |
isBefore(int value) |
Selection |
isBefore(LocalDate value) |
boolean |
isEmpty()
Returns true if the column has no data
|
Selection |
isEqualTo(DateColumn column)
Returns a bitmap flagging the records for which the value in this column is equal to the value in the given
column
Columnwise isEqualTo.
|
Selection |
isEqualTo(LocalDate 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 |
isMissing() |
Selection |
isMonday() |
Selection |
isNotMissing() |
Selection |
isOnOrAfter(int value) |
Selection |
isOnOrAfter(LocalDate value) |
Selection |
isOnOrBefore(int value) |
Selection |
isOnOrBefore(LocalDate value) |
Selection |
isSaturday() |
Selection |
isSunday() |
Selection |
isThursday() |
Selection |
isTuesday() |
Selection |
isWednesday() |
Iterator<LocalDate> |
iterator()
Returns an iterator over elements of type
T. |
LocalDate |
max() |
LocalDate |
min() |
CategoryColumn |
month() |
ShortColumn |
monthValue() |
String |
print() |
it.unimi.dsi.fastutil.ints.IntComparator |
rowComparator() |
Selection |
select(IntBiPredicate predicate,
int value) |
Selection |
select(IntPredicate predicate) |
DateColumn |
selectIf(IntPredicate predicate)
This version operates on predicates that treat the given IntPredicate as operating on a packed local time
This is much more efficient that using a LocalTimePredicate, but requires that the developer understand the
semantics of packedLocalTimes
|
DateColumn |
selectIf(LocalDatePredicate predicate) |
void |
set(int index,
int value) |
void |
set(int index,
LocalDate value) |
void |
set(LocalDate 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(LocalDate.now(), myColumn.isMissing()); // no more missing values
|
int |
size() |
void |
sortAscending() |
void |
sortDescending() |
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
|
String |
toString() |
ColumnType |
type()
Returns this column's ColumnType
|
DateColumn |
unique()
Returns a column of the same type as the receiver, containing only the unique values of the receiver.
|
DateTimeColumn |
with(TimeColumn timeColumn) |
ShortColumn |
year() |
CategoryColumn |
yearMonthString()
Returns a CategoryColumn with the year and month from this column concatenated into a String that will sort
lexicographically in temporal order.
|
columnMetadata, columnWidth, comment, id, metadata, name, setComment, setNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitatStartOfDay, atTime, atTime, dateColumnName, difference, differenceInDays, differenceInMonths, differenceInWeeks, differenceInYears, minus, minusDays, minusMonths, minusWeeks, minusYears, plus, plusDays, plusMonths, plusWeeks, plusYearsasDoubleArray, columnMetadata, columnWidth, comment, first, first, id, last, last, metadata, name, rolling, setComment, setName, subset, titleforEach, spliteratorpublic DateColumn(String name)
public DateColumn(String name, int initialSize)
public DateColumn(ColumnMetadata metadata)
public DateColumn(ColumnMetadata metadata, Locale locale)
public ColumnType type()
Columntype in interface ColumnColumnTypepublic void appendInternal(int f)
public it.unimi.dsi.fastutil.ints.IntArrayList data()
data in interface DateColumnUtilspublic void set(int index,
int value)
public void set(int index,
LocalDate value)
public void append(LocalDate f)
public String getString(int row)
Columnpublic DateColumn emptyCopy()
Columnpublic DateColumn emptyCopy(int rowSize)
Columnpublic DateColumn copy()
Columnpublic void sortAscending()
sortAscending in interface Columnpublic void sortDescending()
sortDescending in interface Columnpublic int countUnique()
ColumncountUnique in interface Columnpublic DateColumn unique()
Columnpublic LocalDate firstElement()
public LocalDate max()
public LocalDate min()
public CategoryColumn dayOfWeek()
public void set(LocalDate newValue, Selection rowSelection)
public ShortColumn dayOfWeekValue()
public ShortColumn dayOfMonth()
public ShortColumn dayOfYear()
public ShortColumn monthValue()
public CategoryColumn yearMonthString()
public CategoryColumn month()
public ShortColumn year()
public LocalDate get(int index)
get in interface DateMapUtilspublic boolean isEmpty()
Columnpublic it.unimi.dsi.fastutil.ints.IntComparator rowComparator()
rowComparator in interface Columnpublic int convert(String value)
value - A string representation of a dateDateTimeParseException - if no parser can be found for the date formatpublic void appendCell(String string)
appendCell in interface ColumnappendCell in class AbstractColumnpublic int getIntInternal(int index)
getIntInternal in interface DateMapUtilspublic Selection isEqualTo(DateColumn column)
public Table summary()
public Selection isAfter(int value)
public Selection isBefore(int value)
public Selection isOnOrBefore(int value)
public Selection isOnOrAfter(int value)
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 isInYear(int year)
public int countMissing()
countMissing in interface Columnpublic Selection isNotMissing()
isNotMissing in interface Columnpublic DateColumn selectIf(LocalDatePredicate predicate)
public DateColumn selectIf(IntPredicate predicate)
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 Selection select(IntPredicate predicate)
public Selection select(IntBiPredicate predicate, int value)
public DateTimeColumn with(TimeColumn timeColumn)
public boolean contains(LocalDate localDate)
public int byteSize()
Columnpublic byte[] asBytes(int rowNumber)
public DateColumn difference()
Columndifference in interface Columndifference in class AbstractColumnColumnCopyright © 2018. All rights reserved.