public class ShortColumn extends NumberColumn<Short> implements CategoricalColumn<Short>
comparator, locale, printFormatterDEFAULT_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.
|
LongColumn |
asLongColumn()
Returns a new LongColumn containing a value for each value in this column
A widening primitive conversion from short to long does not lose any information at all;
the numeric value is preserved exactly.
|
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) |
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.
|
ShortColumn |
filter(Predicate<? super Short> test)
Returns a new Column of the same type with only those rows satisfying the predicate
|
ShortColumn |
first(int numRows) |
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) |
ShortColumn |
inRange(int start,
int end)
Returns a column containing the rows in this column beginning with start inclusive, and ending with end exclusive
|
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 |
last(int numRows) |
ShortColumn |
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.
|
ShortColumn |
map(Function<? super Short,? extends Short> fun)
Maps the function across all rows, appending the results to a new Column of the same type
|
ShortColumn |
max(Column<Short> other)
Returns a column containing the element-wise min between this column and other column
TODO(lwhite) Override in column subtypes for better performance
|
ShortColumn |
min(Column<Short> other)
Returns a column containing the element-wise min between this column and other column
TODO(lwhite) Override in column subtypes for better performance
|
ShortColumn |
removeMissing() |
ShortColumn |
sampleN(int n)
Returns a column containing a random sample of the values in this column
|
ShortColumn |
sampleX(double proportion)
Returns a table consisting of randomly selected values from this column.
|
ShortColumn |
set(int row,
Column<Short> column,
int sourceRow) |
ShortColumn |
set(int i,
short val) |
ShortColumn |
set(int i,
Short val) |
ShortColumn |
set(Selection condition,
Column<Short> other)
Updates this column where values matching the selection are replaced with the corresponding value
from the given column
|
ShortColumn |
set(Selection rowSelection,
Short newValue)
Conditionally update this column, replacing current values with newValue for all rows where the current value
matches the selection criteria
|
Column<Short> |
setMissing(int i) |
ShortColumn |
setName(String name)
Sets the columns name to the given string
|
int |
size() |
void |
sortAscending() |
void |
sortDescending() |
ShortColumn |
sorted(Comparator<? super Short> comp)
Returns a new Column of the same type sorted according to the provided Comparator
|
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) |
ShortColumn |
where(Selection selection) |
allMatch, anyMatch, byteSize, countMissing, noneMatch, rowComparator, setPrintFormatter, setPrintFormatterasStringColumn, name, toString, typeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcountByCategoryallMatch, anyMatch, asList, asStringColumn, byteSize, columnWidth, contains, count, count, countMissing, isEmpty, isMissing, isNotMissing, mapInto, max, min, name, noneMatch, print, reduce, reduce, rolling, rowComparator, summary, title, typeforEach, spliteratorcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongasDoubleArray, asIntColumn, asShortColumn, asStringColumn, count, count, eval, eval, eval, eval, eval, geometricMean, isEmpty, isIn, isIn, isMissing, isNotIn, isNotIn, isNotMissing, kendalls, kurtosis, mapInto, max, max, mean, median, min, min, pearsons, percentile, populationVariance, product, quadraticMean, quartile1, quartile3, range, reduce, reduce, rolling, skewness, spearmans, standardDeviation, stats, sum, summarize, summary, sumOfLogs, sumOfSquares, varianceabs, add, add, add, asPercent, asRatio, bin, cube, cubeRoot, cumProd, cumSum, difference, divide, divide, divide, log10, log1p, logN, multiply, multiply, multiply, name, neg, normalize, pctChange, power, remainder, round, roundInt, sqrt, square, subtract, subtract, subtractisBetweenExclusive, isBetweenInclusive, isCloseTo, isEqualTo, isEqualTo, isGreaterThan, isGreaterThan, isGreaterThanOrEqualTo, isGreaterThanOrEqualTo, isLessThan, isLessThan, isLessThanOrEqualTo, isLessThanOrEqualTo, isNegative, isNonNegative, isNotEqualTo, isNotEqualTo, isPositive, isZeroprotected 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 ShortColumn createCol(String name, int initialSize)
createCol in class NumberColumn<Short>public ShortColumn createCol(String name)
createCol in class NumberColumn<Short>public static boolean valueIsMissing(int value)
public short getShort(int index)
public ShortColumn subset(int[] rows)
public int size()
size in interface Column<Short>size in interface NumberFilterssize in interface NumberMapFunctionspublic ShortColumn unique()
Columnpublic ShortColumn top(int n)
NumberColumntop in class NumberColumn<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)
NumberColumnbottom in class NumberColumn<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)
ColumnFor 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()
Columnpublic ShortColumn emptyCopy(int rowSize)
Columnpublic ShortColumn copy()
Columnpublic 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 ShortColumn append(Column<Short> column)
public String getString(int row)
Columnpublic ShortColumn append(Column<Short> column, int row)
public ShortColumn set(int row, Column<Short> column, int sourceRow)
public ShortColumn appendMissing()
ColumnappendMissing in interface Column<Short>appendMissing in class NumberColumn<Short>public byte[] asBytes(int rowNumber)
NumberColumnpublic int countUnique()
ColumncountUnique in interface Column<Short>public int getInt(int row)
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 NumberFiltersgetDouble in interface NumberMapFunctionspublic boolean isMissingValue(short value)
public boolean isMissing(int rowNumber)
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 ShortColumn inRange(int start, int end)
Columnpublic ShortColumn where(Selection selection)
public ShortColumn lead(int n)
Columnpublic ShortColumn setName(String name)
Columnpublic ShortColumn filter(Predicate<? super Short> test)
Columnpublic ShortColumn sorted(Comparator<? super Short> comp)
Columnpublic ShortColumn map(Function<? super Short,? extends Short> fun)
Columnpublic ShortColumn min(Column<Short> other)
Columnpublic ShortColumn max(Column<Short> other)
Columnpublic ShortColumn set(Selection condition, Column<Short> other)
Columnpublic ShortColumn set(Selection rowSelection, Short newValue)
Columnpublic ShortColumn first(int numRows)
public ShortColumn last(int numRows)
public ShortColumn sampleN(int n)
Columnpublic ShortColumn sampleX(double proportion)
Columnpublic LongColumn asLongColumn()
asLongColumn in interface NumericColumn<Short>public FloatColumn asFloatColumn()
asFloatColumn in interface NumericColumn<Short>public DoubleColumn asDoubleColumn()
asDoubleColumn in interface NumericColumn<Short>Copyright © 2019. All rights reserved.