Iterable<Instant>
, Comparator<Instant>
, CategoricalColumn<Instant>
, Column<Instant>
, InstantMapFunctions
, TemporalColumn<Instant>
, TemporalFillers<Instant,InstantColumn>
, TemporalFilters<Instant>
, TemporalMapFunctions<Instant>
, FilterSpec<Instant>
, InstantFilterSpec<Instant>
public class InstantColumn extends AbstractColumn<InstantColumn,Instant> implements InstantMapFunctions, TemporalFillers<Instant,InstantColumn>, TemporalFilters<Instant>, CategoricalColumn<Instant>
Instant
, which have nanosecond precisionModifier and Type | Field | Description |
---|---|---|
protected it.unimi.dsi.fastutil.longs.LongArrayList |
data |
DEFAULT_ARRAY_SIZE
Modifier and Type | Method | Description |
---|---|---|
InstantColumn |
append(Instant dateTime) |
Appends value to the bottom of this column and return this column
|
InstantColumn |
append(Column<Instant> column) |
Appends all the values in the argument to the bottom of this column and return this column
|
InstantColumn |
append(Column<Instant> column,
int row) |
Appends the value at the given row in the given column to the bottom of this column and return
this column
|
InstantColumn |
appendCell(String stringValue) |
Add one element to the bottom of this column and set its value to the parsed value of the given
String.
|
InstantColumn |
appendCell(String stringValue,
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
|
InstantColumn |
appendInternal(long dateTime) |
Returns this column with the argument appended at the bottom
|
InstantColumn |
appendMissing() |
Appends a missing value appropriate to the column
|
InstantColumn |
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() |
|
long[] |
asEpochMillisArray() |
Returns an array where each entry is the difference, measured in milliseconds, between the
Instant and midnight, January 1, 1970 UTC.
|
long[] |
asEpochMillisArray(ZoneOffset offset) |
Returns an array where each entry is the difference, measured in milliseconds, between the
Instant and midnight, January 1, 1970 UTC.
|
long[] |
asEpochSecondArray() |
Returns an array where each entry is the difference, measured in seconds, between the Instant
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
|
DateTimeColumn |
asLocalDateTimeColumn() |
Returns a DateTimeColumn where each element is a representation of the associated Instant
translated using UTC as the timezone
|
DateTimeColumn |
asLocalDateTimeColumn(ZoneId zone) |
Returns a DateTimeColumn where each element is a representation of the associated Instant
translated using the argument as the timezone
|
Instant[] |
asObjectArray() |
Returns an array of objects as appropriate for my type of column
|
Set<Instant> |
asSet() |
|
List<Instant> |
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(Instant o1,
Instant o2) |
|
boolean |
contains(Instant dateTime) |
Returns
true if the given object appears in this column, and false otherwise |
InstantColumn |
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 InstantColumn |
create(String name) |
|
static InstantColumn |
create(String name,
int initialSize) |
|
static InstantColumn |
create(String name,
Instant... data) |
|
static InstantColumn |
create(String name,
Collection<Instant> data) |
|
static InstantColumn |
create(String name,
Stream<Instant> stream) |
|
static InstantColumn |
createInternal(String name,
long[] data) |
For internal Tablesaw use only Returns a new column with the given name and data
|
InstantColumn |
emptyCopy() |
Returns a copy of the receiver with no data.
|
InstantColumn |
emptyCopy(int rowSize) |
Returns an empty copy of the receiver, with its internal storage initialized to the given row
size.
|
InstantColumn |
fillWith(Iterable<Instant> iterable) |
|
InstantColumn |
fillWith(Supplier<Instant> supplier) |
|
InstantColumn |
fillWith(Iterator<Instant> iterator) |
|
Instant |
get(int index) |
Returns a value of the Object type stored in the column (e.g.
|
double |
getDouble(int i) |
|
long |
getLongInternal(int index) |
Returns the internal (long-encoded) value stored in the column at the given row
|
protected long |
getPackedDateTime(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
|
boolean |
isEmpty() |
Returns true if the column has no data
|
Selection |
isMissing() |
Returns a selection containing an index for every missing value in this column
|
boolean |
isMissing(int rowNumber) |
Returns true if the value at rowNumber is missing
|
Selection |
isNotMissing() |
Returns a selection containing an index for every non-missing value in this column
|
Iterator<Instant> |
iterator() |
Returns an iterator over elements of type
T . |
InstantColumn |
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() |
Returns an iterator over the long representations of the instants in this column
|
Instant |
max() |
|
Instant |
min() |
|
InstantColumn |
plus(long amountToAdd,
ChronoUnit unit) |
|
InstantColumn |
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
|
InstantColumn |
set(int index,
long value) |
|
InstantColumn |
set(int index,
Instant value) |
Sets the value at index row to the given value and return this column
|
InstantColumn |
set(int row,
Column<Instant> column,
int sourceRow) |
Sets the value at row to the value at sourceRow in the given column and return this column
|
InstantColumn |
set(Selection rowSelection,
Instant newValue) |
Conditionally update this column, replacing current values with newValue for all rows where the
current value matches the selection criteria
|
InstantColumn |
setMissing(int i) |
Sets the value at index i to the missing-value indicator for this column type, and return this
column
|
void |
setPrintFormatter(InstantColumnFormatter formatter) |
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
|
InstantColumn |
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 containing a ColumnType specific summary of the data in this column
|
List<Instant> |
top(int n) |
Returns the largest ("top") n values in the column
|
InstantColumn |
unique() |
Returns a column of the same type containing only the unique values
|
static boolean |
valueIsMissing(long value) |
|
InstantColumn |
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, asList, asStringColumn, columnWidth, count, count, filter, first, indexOf, inRange, interpolate, last, lead, 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
plusDays, plusHours, plusMicros, plusMillis, plusMinutes, plusMonths, plusSeconds, plusWeeks, plusYears
forEach, spliterator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
eval, eval, eval, eval, eval, isAfter, isBefore, isBetweenExcluding, isBetweenIncluding, isEqualTo
difference, differenceInDays, differenceInHours, differenceInMilliseconds, differenceInMinutes, differenceInSeconds, differenceInYears, missingValues, temporalColumnName
public static InstantColumn create(String name)
public static InstantColumn createInternal(String name, long[] data)
name
- The column namedata
- An array of longs representing Instant values in Tablesaw internal formatpublic static InstantColumn create(String name, int initialSize)
public static InstantColumn create(String name, Collection<Instant> data)
public static InstantColumn create(String name, Instant... data)
public static InstantColumn create(String name, Stream<Instant> stream)
public static boolean valueIsMissing(long value)
public boolean isMissing(int rowNumber)
public InstantColumn plus(long amountToAdd, ChronoUnit unit)
plus
in interface InstantMapFunctions
plus
in interface TemporalMapFunctions<Instant>
public InstantColumn subset(int[] rows)
subset
in interface Column<Instant>
subset
in class AbstractColumn<InstantColumn,Instant>
public InstantColumn removeMissing()
removeMissing
in interface Column<Instant>
public boolean contains(Instant dateTime)
true
if the given object appears in this column, and false otherwise
TODO override in column subtypes for performance
public InstantColumn setMissing(int i)
setMissing
in interface Column<Instant>
public InstantColumn where(Selection selection)
Selection
public void setPrintFormatter(InstantColumnFormatter formatter)
public InstantColumn 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 InstantColumn appendCell(String stringValue)
appendCell
in interface Column<Instant>
public InstantColumn appendCell(String stringValue, AbstractColumnParser<?> parser)
appendCell
in interface Column<Instant>
public InstantColumn append(Instant dateTime)
public InstantColumn appendObj(Object obj)
public int size()
public InstantColumn appendInternal(long dateTime)
appendInternal
in interface TemporalColumn<Instant>
public String getString(int row)
public String getUnformattedString(int row)
getUnformattedString
in interface Column<Instant>
public InstantColumn emptyCopy()
emptyCopy
in interface Column<Instant>
emptyCopy
in interface TemporalMapFunctions<Instant>
emptyCopy
in class AbstractColumn<InstantColumn,Instant>
Column
public InstantColumn emptyCopy(int rowSize)
public InstantColumn copy()
public void clear()
public void sortAscending()
sortAscending
in interface Column<Instant>
public void sortDescending()
sortDescending
in interface Column<Instant>
public Table summary()
public int countUnique()
countUnique
in interface Column<Instant>
public InstantColumn unique()
public boolean isEmpty()
public long getLongInternal(int index)
getLongInternal
in interface TemporalColumn<Instant>
getLongInternal
in interface TemporalFilters<Instant>
protected long getPackedDateTime(int index)
public Instant get(int index)
get
in interface Column<Instant>
get
in interface TemporalColumn<Instant>
get
in interface TemporalFilters<Instant>
public it.unimi.dsi.fastutil.ints.IntComparator rowComparator()
rowComparator
in interface Column<Instant>
public InstantColumn set(Selection rowSelection, Instant newValue)
Example: myColumn.set(myColumn.valueIsMissing(), Instant.now()); // no more missing values
set
in interface Column<Instant>
set
in class AbstractColumn<InstantColumn,Instant>
public int countMissing()
countMissing
in interface Column<Instant>
public long[] asEpochSecondArray()
If a value is missing, InstantColumnType.missingValueIndicator() is used
public long[] asEpochSecondArray(ZoneOffset offset)
If a value is missing, InstantColumnType.missingValueIndicator() is used
public long[] asEpochMillisArray()
If a missing value is encountered, InstantColumnType.missingValueIndicator() is inserted in the array
public long[] asEpochMillisArray(ZoneOffset offset)
If a missing value is encountered, InstantColumnType.missingValueIndicator() is inserted in the array
public DateTimeColumn asLocalDateTimeColumn()
public DateTimeColumn asLocalDateTimeColumn(ZoneId zone)
public InstantColumn append(Column<Instant> column)
public InstantColumn append(Column<Instant> column, int row)
public InstantColumn set(int row, Column<Instant> column, int sourceRow)
public Instant max()
public InstantColumn appendMissing()
appendMissing
in interface Column<Instant>
public Instant min()
min
in interface TemporalMapFunctions<Instant>
public InstantColumn set(int index, long value)
public InstantColumn set(int index, Instant value)
public List<Instant> 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<Instant> 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 int byteSize()
public byte[] asBytes(int rowNumber)
public double getDouble(int i)
public double[] asDoubleArray()
public DoubleColumn asDoubleColumn()
public InstantColumn fillWith(Iterator<Instant> iterator)
fillWith
in interface TemporalFillers<Instant,InstantColumn>
public InstantColumn fillWith(Iterable<Instant> iterable)
fillWith
in interface TemporalFillers<Instant,InstantColumn>
public InstantColumn fillWith(Supplier<Instant> supplier)
fillWith
in interface TemporalFillers<Instant,InstantColumn>
public Instant[] asObjectArray()
asObjectArray
in interface Column<Instant>
public int compare(Instant o1, Instant o2)
compare
in interface Comparator<Instant>
public Selection isMissing()
isMissing
in interface Column<Instant>
isMissing
in interface FilterSpec<Instant>
isMissing
in interface TemporalFilters<Instant>
public Selection isNotMissing()
isNotMissing
in interface Column<Instant>
isNotMissing
in interface FilterSpec<Instant>
isNotMissing
in interface TemporalFilters<Instant>
Copyright © 2021. All rights reserved.