public class ShortColumn extends NumberColumn<ShortColumn,Short> implements CategoricalColumn<Short>
comparator, locale
DEFAULT_ARRAY_SIZE
Modifier | Constructor and Description |
---|---|
protected |
ShortColumn(String name,
it.unimi.dsi.fastutil.shorts.ShortArrayList data) |
Modifier and Type | Method and Description |
---|---|
ShortColumn |
append(Column<Short> column) |
ShortColumn |
append(Column<Short> column,
int row) |
ShortColumn |
append(short i) |
ShortColumn |
append(Short val) |
ShortColumn |
appendCell(String value) |
ShortColumn |
appendCell(String value,
AbstractColumnParser<?> parser) |
ShortColumn |
appendMissing()
Appends a missing value appropriate to the column
|
ShortColumn |
appendObj(Object obj) |
byte[] |
asBytes(int rowNumber)
Returns the contents of the cell at rowNumber as a byte[]
|
DoubleColumn |
asDoubleColumn()
Returns a new DoubleColumn containing a value for each value in this column, truncating if
necessary.
|
FloatColumn |
asFloatColumn()
Returns a new FloatColumn containing a value for each value in this column, truncating if
necessary.
|
IntColumn |
asIntColumn()
Returns a new IntColumn containing a value for each value in this column
|
LongColumn |
asLongColumn()
Returns a new LongColumn containing a value for each value in this column
|
Short[] |
asObjectArray() |
ShortColumn |
bottom(int n)
Returns the smallest ("bottom") n values in the column TODO(lwhite): Consider whether this
should exclude missing
|
void |
clear() |
int |
compare(Short o1,
Short o2) |
ShortColumn |
copy()
Returns a deep copy of the receiver
|
int |
countUnique()
Returns the count of unique values in this column.
|
static ShortColumn |
create(String name) |
static ShortColumn |
create(String name,
int initialSize) |
static ShortColumn |
create(String name,
short... arr) |
static ShortColumn |
create(String name,
Short[] arr) |
static ShortColumn |
create(String name,
Stream<Short> stream) |
ShortColumn |
createCol(String name) |
ShortColumn |
createCol(String name,
int initialSize) |
ShortColumn |
emptyCopy()
Returns a copy of the receiver with no data.
|
ShortColumn |
emptyCopy(int rowSize)
Returns an empty copy of the receiver, with its internal storage initialized to the given row
size.
|
Short |
get(int index) |
double |
getDouble(int row) |
int |
getInt(int row)
Returns the value at the given index.
|
short |
getShort(int index) |
String |
getString(int row)
Returns a string representation of the value at the given row.
|
String |
getUnformattedString(int row) |
boolean |
isMissing(int rowNumber) |
boolean |
isMissingValue(short value) |
Iterator<Short> |
iterator() |
ShortColumn |
lag(int n)
Returns a column of the same type and size as the receiver, containing the receivers values
offset by n.
|
ShortColumn |
removeMissing() |
ShortColumn |
set(int row,
Column<Short> column,
int sourceRow) |
ShortColumn |
set(int i,
short val) |
ShortColumn |
set(int i,
Short val) |
Column<Short> |
set(int row,
String stringValue,
AbstractColumnParser<?> parser) |
Column<Short> |
setMissing(int i) |
int |
size() |
void |
sortAscending() |
void |
sortDescending() |
ShortColumn |
subset(int[] rows) |
ShortColumn |
top(int n)
Returns the largest ("top") n values in the column TODO(lwhite): Consider whether this should
exclude missing
|
ShortColumn |
unique()
Returns a column of the same type as the receiver, containing only the unique values of the
receiver.
|
static boolean |
valueIsMissing(int value) |
byteSize, countMissing, getPrintFormatter, rowComparator, set, set, setPrintFormatter, setPrintFormatter
asStringColumn, filter, first, inRange, last, map, max, min, name, sampleN, sampleX, set, set, setName, sorted, toString, type
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
countByCategory
allMatch, anyMatch, asList, asStringColumn, byteSize, columnWidth, contains, count, count, countMissing, filter, first, inRange, interpolate, isEmpty, isMissing, isNotMissing, last, lead, map, map, mapInto, max, max, min, min, name, noneMatch, print, reduce, reduce, rolling, rowComparator, sampleN, sampleX, set, set, set, setMissingTo, setName, sorted, summary, title, type, where
forEach, spliterator
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
allMatch, anyMatch, asDoubleArray, asShortColumn, asStringColumn, autoCorrelation, autoCorrelation, count, count, eval, eval, geometricMean, interpolate, isEmpty, isIn, isIn, isMissing, isNotIn, isNotIn, isNotMissing, kendalls, kurtosis, lead, mapInto, max, max, mean, median, min, min, noneMatch, pctChange, pearsons, percentile, populationVariance, product, quadraticMean, quartile1, quartile3, range, reduce, reduce, rolling, skewness, spearmans, standardDeviation, stats, sum, summarize, summary, sumOfLogs, sumOfSquares, variance, where
abs, add, add, add, asPercent, asRatio, bin, cube, cubeRoot, cumMax, cumMin, cumProd, cumSum, difference, divide, divide, divide, log10, log1p, logN, multiply, multiply, multiply, name, neg, normalize, pctChange, power, power, reciprocal, remainder, remainder, round, roundInt, sqrt, square, subtract, subtract, subtract
isBetweenExclusive, isBetweenInclusive, isCloseTo, isEqualTo, isEqualTo, isGreaterThan, isGreaterThan, isGreaterThanOrEqualTo, isGreaterThanOrEqualTo, isLessThan, isLessThan, isLessThanOrEqualTo, isLessThanOrEqualTo, isNegative, isNonNegative, isNotEqualTo, isNotEqualTo, isPositive, isZero
protected ShortColumn(String name, it.unimi.dsi.fastutil.shorts.ShortArrayList data)
public static ShortColumn create(String name)
public static ShortColumn create(String name, short... arr)
public static ShortColumn create(String name, int initialSize)
public static ShortColumn create(String name, Short[] arr)
public static ShortColumn create(String name, Stream<Short> stream)
public ShortColumn createCol(String name, int initialSize)
createCol
in class NumberColumn<ShortColumn,Short>
public ShortColumn createCol(String name)
createCol
in class NumberColumn<ShortColumn,Short>
public static boolean valueIsMissing(int value)
public short getShort(int index)
public ShortColumn subset(int[] rows)
subset
in interface Column<Short>
subset
in class AbstractColumn<ShortColumn,Short>
public int size()
size
in interface Column<Short>
size
in interface NumberFilters
size
in interface NumberMapFunctions
public ShortColumn unique()
Column
public ShortColumn top(int n)
NumberColumn
top
in class NumberColumn<ShortColumn,Short>
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 ShortColumn bottom(int n)
NumberColumn
bottom
in class NumberColumn<ShortColumn,Short>
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 ShortColumn 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
public ShortColumn removeMissing()
removeMissing
in interface Column<Short>
public ShortColumn append(short i)
public ShortColumn append(Short val)
public ShortColumn emptyCopy()
Column
emptyCopy
in interface Column<Short>
emptyCopy
in class NumberColumn<ShortColumn,Short>
Column
public ShortColumn emptyCopy(int rowSize)
Column
emptyCopy
in interface Column<Short>
emptyCopy
in class NumberColumn<ShortColumn,Short>
rowSize
- the initial row sizeColumn
public ShortColumn copy()
Column
copy
in interface NumericColumn<Short>
copy
in interface Column<Short>
copy
in class NumberColumn<ShortColumn,Short>
Column
public Short[] asObjectArray()
asObjectArray
in interface Column<Short>
public int compare(Short o1, Short o2)
compare
in interface Comparator<Short>
public ShortColumn set(int i, Short val)
public ShortColumn set(int i, short val)
public Column<Short> set(int row, String stringValue, AbstractColumnParser<?> parser)
public ShortColumn append(Column<Short> column)
public String getString(int row)
Column
getString
in interface Column<Short>
getString
in class NumberColumn<ShortColumn,Short>
row
- The index of the row.public ShortColumn append(Column<Short> column, int row)
public ShortColumn set(int row, Column<Short> column, int sourceRow)
public ShortColumn appendMissing()
Column
appendMissing
in interface Column<Short>
appendMissing
in class NumberColumn<ShortColumn,Short>
public byte[] asBytes(int rowNumber)
NumberColumn
asBytes
in interface Column<Short>
asBytes
in class NumberColumn<ShortColumn,Short>
rowNumber
- index of the rowpublic int countUnique()
Column
countUnique
in interface Column<Short>
public int getInt(int row)
Returns the closest int
to the argument, with ties rounding to positive infinity.
Special cases:
Special cases:
Integer.MAX_VALUE
, an error will be thrown
row
- the index of the value to be rounded to an integer.int
value.ClassCastException
- if the absolute value of the value to be rounded is too large to be
cast to an intpublic double getDouble(int row)
getDouble
in interface NumericColumn<Short>
getDouble
in interface NumberFilters
getDouble
in interface NumberMapFunctions
public boolean isMissingValue(short value)
public boolean isMissing(int rowNumber)
isMissing
in interface Column<Short>
isMissing
in interface NumberMapFunctions
public Column<Short> setMissing(int i)
setMissing
in interface Column<Short>
public void sortAscending()
sortAscending
in interface Column<Short>
public void sortDescending()
sortDescending
in interface Column<Short>
public ShortColumn appendObj(Object obj)
public ShortColumn appendCell(String value)
appendCell
in interface Column<Short>
public ShortColumn appendCell(String value, AbstractColumnParser<?> parser)
appendCell
in interface Column<Short>
public String getUnformattedString(int row)
getUnformattedString
in interface Column<Short>
public LongColumn asLongColumn()
A widening primitive conversion from short to long does not lose any information at all; the numeric value is preserved exactly.
A missing value in the receiver is converted to a missing value in the result
asLongColumn
in interface NumericColumn<Short>
public FloatColumn asFloatColumn()
A widening primitive conversion from an int to a float does not lose information about the overall magnitude of a numeric value. It may, however, result in loss of precision - that is, the result may lose some of the least significant bits of the value. In this case, the resulting floating-point value will be a correctly rounded version of the integer value, using IEEE 754 round-to-nearest mode.
Despite the fact that a loss of precision may occur, a widening primitive conversion never results in a run-time exception.
A missing value in the receiver is converted to a missing value in the result
asFloatColumn
in interface NumericColumn<Short>
public DoubleColumn asDoubleColumn()
A widening primitive conversion from an int to a double does not lose information about the overall magnitude of a numeric value. It may, however, result in loss of precision - that is, the result may lose some of the least significant bits of the value. In this case, the resulting floating-point value will be a correctly rounded version of the integer value, using IEEE 754 round-to-nearest mode.
Despite the fact that a loss of precision may occur, a widening primitive conversion never results in a run-time exception.
A missing value in the receiver is converted to a missing value in the result
asDoubleColumn
in interface NumericColumn<Short>
public IntColumn asIntColumn()
NumericColumn
The exact behavior when overridden depends on the type of the receiver (LongColumn, FloatColumn, etc.)
In this version, the result is a copy of the original
asIntColumn
in interface NumericColumn<Short>
Copyright © 2020. All rights reserved.