public class BooleanColumn extends AbstractColumn<Boolean> implements BooleanMapUtils, CategoricalColumn<Boolean>, BooleanFillers<BooleanColumn>
DEFAULT_ARRAY_SIZE
Modifier and Type | Method and Description |
---|---|
boolean |
all()
Returns true if the column contains only true values, and false otherwise.
|
boolean |
any()
Returns true if the column contains any true values, and false otherwise
|
BooleanColumn |
append(boolean b) |
BooleanColumn |
append(Boolean b) |
BooleanColumn |
append(byte b) |
BooleanColumn |
append(Column<Boolean> column) |
Column<Boolean> |
append(Column<Boolean> column,
int row) |
BooleanColumn |
appendCell(String object) |
BooleanColumn |
appendCell(String object,
AbstractColumnParser<?> parser) |
BooleanColumn |
appendMissing()
Appends a missing value appropriate to the column
|
BooleanColumn |
appendObj(Object obj) |
byte[] |
asBytes(int row)
Returns the contents of the cell at rowNumber as a byte[].
|
double[] |
asDoubleArray() |
DoubleColumn |
asDoubleColumn() |
Boolean[] |
asObjectArray() |
Selection |
asSelection() |
it.unimi.dsi.fastutil.booleans.BooleanSet |
asSet() |
it.unimi.dsi.fastutil.bytes.ByteIterator |
byteIterator() |
int |
byteSize()
Returns the width of a cell in this column, in bytes.
|
void |
clear() |
int |
compare(Boolean o1,
Boolean o2) |
boolean |
contains(boolean aBoolean) |
BooleanColumn |
copy()
Returns a deep copy of the receiver
|
int |
countFalse() |
int |
countMissing()
Returns the count of missing values in this column
|
int |
countTrue() |
int |
countUnique()
Returns the count of unique values in this column.
|
static BooleanColumn |
create(String name) |
static BooleanColumn |
create(String name,
boolean[] values) |
static BooleanColumn |
create(String name,
Boolean[] objects) |
static BooleanColumn |
create(String name,
int initialSize) |
static BooleanColumn |
create(String name,
List<Boolean> values) |
static BooleanColumn |
create(String name,
Selection hits,
int columnSize) |
it.unimi.dsi.fastutil.bytes.ByteArrayList |
data()
Returns a ByteArrayList containing 0 (false), 1 (true) or Byte.MIN_VALUE (missing)
|
BooleanColumn |
emptyCopy()
Returns a copy of the receiver with no data.
|
BooleanColumn |
emptyCopy(int rowSize)
Returns an empty copy of the receiver, with its internal storage initialized to the given row size.
|
boolean |
equals(Object o) |
Selection |
eval(BiPredicate<Boolean,Boolean> predicate,
Boolean valueToCompare) |
Selection |
eval(BytePredicate predicate) |
Selection |
eval(Predicate<Boolean> predicate) |
BooleanColumn |
fillWith(it.unimi.dsi.fastutil.booleans.BooleanIterable iterable) |
BooleanColumn |
fillWith(it.unimi.dsi.fastutil.booleans.BooleanIterator iterator) |
BooleanColumn |
fillWith(Supplier<Boolean> supplier) |
BooleanColumn |
filter(Predicate<? super Boolean> test)
Returns a new Column of the same type with only those rows satisfying the predicate
|
BooleanColumn |
first(int numRows) |
Boolean |
get(int i)
Returns the value in row i as a Boolean
|
byte |
getByte(int i)
Returns the value in row i as a byte (0, 1, or Byte.MIN_VALUE representing missing data)
|
double |
getDouble(int row) |
BooleanFormatter |
getPrintFormatter() |
String |
getString(int row)
Returns a string representation of the value at the given row.
|
String |
getUnformattedString(int row) |
int |
hashCode() |
BooleanColumn |
inRange(int start,
int end)
Returns a column containing the rows in this column beginning with start inclusive, and ending with end exclusive
|
boolean |
isEmpty()
Returns true if the column has no data
|
Selection |
isEqualTo(BooleanColumn other) |
Selection |
isFalse() |
Selection |
isMissing() |
boolean |
isMissing(int rowNumber) |
Selection |
isNotMissing() |
Selection |
isTrue() |
Iterator<Boolean> |
iterator() |
BooleanColumn |
lag(int n)
Returns a column of the same type and size as the receiver, containing the receivers values offset by n.
|
BooleanColumn |
last(int numRows) |
BooleanColumn |
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.
|
BooleanColumn |
map(Function<? super Boolean,? extends Boolean> fun)
Maps the function across all rows, appending the results to a new Column of the same type
|
BooleanColumn |
max(Column<Boolean> other)
Returns a column containing the element-wise min between this column and other column
TODO(lwhite) Override in column subtypes for better performance
|
BooleanColumn |
min(Column<Boolean> other)
Returns a column containing the element-wise min between this column and other column
TODO(lwhite) Override in column subtypes for better performance
|
boolean |
none()
Returns true if the column contains no true values, and false otherwise
|
double |
proportionFalse()
Returns the proportion of non-missing row elements that contain true
|
double |
proportionTrue()
Returns the proportion of non-missing row elements that contain true
|
BooleanColumn |
removeMissing() |
it.unimi.dsi.fastutil.ints.IntComparator |
rowComparator() |
BooleanColumn |
sampleN(int n)
Returns a column containing a random sample of the values in this column
|
BooleanColumn |
sampleX(double proportion)
Returns a table consisting of randomly selected values from this column.
|
BooleanColumn |
set(int i,
boolean b) |
BooleanColumn |
set(int i,
Boolean val) |
Column<Boolean> |
set(int row,
Column<Boolean> column,
int sourceRow) |
BooleanColumn |
set(Selection rowSelection,
boolean newValue)
Conditionally update this column, replacing current values with newValue for all rows where the current value
matches the selection criteria
|
BooleanColumn |
set(Selection rowSelection,
Boolean newValue)
Conditionally update this column, replacing current values with newValue for all rows where the current value
matches the selection criteria
|
BooleanColumn |
set(Selection condition,
Column<Boolean> other)
Updates this column where values matching the selection are replaced with the corresponding value
from the given column
|
Column<Boolean> |
setMissing(int i) |
BooleanColumn |
setName(String name)
Sets the columns name to the given string
|
void |
setPrintFormatter(BooleanFormatter formatter) |
int |
size() |
void |
sortAscending() |
void |
sortDescending() |
BooleanColumn |
sorted(Comparator<? super Boolean> comp)
Returns a new Column of the same type sorted according to the provided Comparator
|
BooleanColumn |
subset(int[] rows) |
Table |
summary() |
BooleanColumn |
unique()
Returns a column of the same type as the receiver, containing only the unique values of the receiver.
|
static boolean |
valueIsMissing(byte b) |
BooleanColumn |
where(Selection selection) |
asStringColumn, name, toString, type
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
and, andNot, or
countByCategory
allMatch, anyMatch, asList, asStringColumn, columnWidth, contains, count, count, mapInto, max, min, name, noneMatch, print, reduce, reduce, rolling, title, type
forEach, spliterator
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public static boolean valueIsMissing(byte b)
public boolean isMissing(int rowNumber)
public Column<Boolean> setMissing(int i)
setMissing
in interface Column<Boolean>
public static BooleanColumn create(String name, Selection hits, int columnSize)
public static BooleanColumn create(String name)
public static BooleanColumn create(String name, int initialSize)
public static BooleanColumn create(String name, boolean[] values)
public static BooleanColumn create(String name, List<Boolean> values)
public static BooleanColumn create(String name, Boolean[] objects)
public BooleanColumn setName(String name)
Column
public BooleanColumn subset(int[] rows)
public BooleanColumn set(Selection rowSelection, Boolean newValue)
Column
public BooleanColumn first(int numRows)
public BooleanColumn last(int numRows)
public BooleanColumn inRange(int start, int end)
Column
public BooleanColumn sampleN(int n)
Column
public BooleanColumn sampleX(double proportion)
Column
public BooleanColumn set(Selection condition, Column<Boolean> other)
Column
public BooleanColumn min(Column<Boolean> other)
Column
public BooleanColumn max(Column<Boolean> other)
Column
public BooleanColumn map(Function<? super Boolean,? extends Boolean> fun)
Column
public BooleanColumn sorted(Comparator<? super Boolean> comp)
Column
public void setPrintFormatter(BooleanFormatter formatter)
public BooleanFormatter getPrintFormatter()
public int countMissing()
countMissing
in interface Column<Boolean>
public int countUnique()
Column
countUnique
in interface Column<Boolean>
public BooleanColumn unique()
Column
public BooleanColumn append(boolean b)
public BooleanColumn append(Boolean b)
public BooleanColumn appendObj(Object obj)
public BooleanColumn append(byte b)
public BooleanColumn appendMissing()
Column
appendMissing
in interface Column<Boolean>
public String getString(int row)
Column
public String getUnformattedString(int row)
getUnformattedString
in interface Column<Boolean>
public BooleanColumn emptyCopy()
Column
public BooleanColumn emptyCopy(int rowSize)
Column
public BooleanColumn copy()
Column
public void sortAscending()
sortAscending
in interface Column<Boolean>
public void sortDescending()
sortDescending
in interface Column<Boolean>
public BooleanColumn appendCell(String object)
appendCell
in interface Column<Boolean>
public BooleanColumn appendCell(String object, AbstractColumnParser<?> parser)
appendCell
in interface Column<Boolean>
public Boolean get(int i)
public byte getByte(int i)
i
- the row numberpublic boolean isEmpty()
Column
public int countTrue()
public int countFalse()
public double proportionTrue()
public double proportionFalse()
public boolean any()
public boolean all()
public boolean none()
public Selection isFalse()
public Selection isTrue()
public Selection isEqualTo(BooleanColumn other)
public it.unimi.dsi.fastutil.bytes.ByteArrayList data()
public BooleanColumn set(int i, boolean b)
public BooleanColumn set(int i, Boolean val)
public BooleanColumn lead(int n)
Column
public BooleanColumn 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 BooleanColumn set(Selection rowSelection, boolean newValue)
public BooleanColumn filter(Predicate<? super Boolean> test)
Column
public double getDouble(int row)
public double[] asDoubleArray()
public it.unimi.dsi.fastutil.ints.IntComparator rowComparator()
rowComparator
in interface Column<Boolean>
public BooleanColumn append(Column<Boolean> column)
public Selection asSelection()
asSelection
in interface BooleanMapUtils
public Selection isNotMissing()
isNotMissing
in interface Column<Boolean>
public it.unimi.dsi.fastutil.bytes.ByteIterator byteIterator()
public it.unimi.dsi.fastutil.booleans.BooleanSet asSet()
public boolean contains(boolean aBoolean)
public int byteSize()
Column
public byte[] asBytes(int row)
Column
public BooleanColumn where(Selection selection)
public BooleanColumn removeMissing()
removeMissing
in interface Column<Boolean>
public Selection eval(BytePredicate predicate)
public Selection eval(BiPredicate<Boolean,Boolean> predicate, Boolean valueToCompare)
public DoubleColumn asDoubleColumn()
public int compare(Boolean o1, Boolean o2)
compare
in interface Comparator<Boolean>
public boolean equals(Object o)
equals
in interface Comparator<Boolean>
equals
in class Object
public BooleanColumn fillWith(it.unimi.dsi.fastutil.booleans.BooleanIterator iterator)
fillWith
in interface BooleanFillers<BooleanColumn>
public BooleanColumn fillWith(it.unimi.dsi.fastutil.booleans.BooleanIterable iterable)
fillWith
in interface BooleanFillers<BooleanColumn>
public BooleanColumn fillWith(Supplier<Boolean> supplier)
fillWith
in interface BooleanFillers<BooleanColumn>
public Boolean[] asObjectArray()
asObjectArray
in interface Column<Boolean>
Copyright © 2019. All rights reserved.