Search in sources :

Example 6 with BooleanColumn

use of tech.tablesaw.api.BooleanColumn in project symja_android_library by axkr.

the class BooleanMapUtils method or.

default BooleanColumn or(BooleanColumn... columns) {
    StringBuilder name = new StringBuilder(name()).append(" or: ");
    Selection selection = asSelection();
    for (BooleanColumn column : columns) {
        if (!column.name().equals(columns[0].name())) {
            name.append(", ");
        }
        name.append(column.name());
        selection.or(column.asSelection());
    }
    return BooleanColumn.create(name.toString(), selection, size());
}
Also used : Selection(tech.tablesaw.selection.Selection) BooleanColumn(tech.tablesaw.api.BooleanColumn)

Example 7 with BooleanColumn

use of tech.tablesaw.api.BooleanColumn in project symja_android_library by axkr.

the class BooleanMapUtils method and.

/*
   * Returns a Boolean column made by and-ing this column with the arguments
   */
default BooleanColumn and(BooleanColumn... columns) {
    StringBuilder name = new StringBuilder(name()).append(" and: ");
    Selection selection = asSelection();
    for (BooleanColumn column : columns) {
        if (!column.name().equals(columns[0].name())) {
            name.append(", ");
        }
        name.append(column.name());
        selection.and(column.asSelection());
    }
    return BooleanColumn.create(name.toString(), selection, size());
}
Also used : Selection(tech.tablesaw.selection.Selection) BooleanColumn(tech.tablesaw.api.BooleanColumn)

Aggregations

BooleanColumn (tech.tablesaw.api.BooleanColumn)7 ArrayList (java.util.ArrayList)3 Selection (tech.tablesaw.selection.Selection)3 Byte2ObjectMap (it.unimi.dsi.fastutil.bytes.Byte2ObjectMap)1 ByteArrayList (it.unimi.dsi.fastutil.bytes.ByteArrayList)1 Int2ObjectMap (it.unimi.dsi.fastutil.ints.Int2ObjectMap)1 IntArrayList (it.unimi.dsi.fastutil.ints.IntArrayList)1 Short2ObjectMap (it.unimi.dsi.fastutil.shorts.Short2ObjectMap)1 ShortArrayList (it.unimi.dsi.fastutil.shorts.ShortArrayList)1 ResultSetMetaData (java.sql.ResultSetMetaData)1 ColumnType (tech.tablesaw.api.ColumnType)1 DoubleColumn (tech.tablesaw.api.DoubleColumn)1 FloatColumn (tech.tablesaw.api.FloatColumn)1 IntColumn (tech.tablesaw.api.IntColumn)1 LongColumn (tech.tablesaw.api.LongColumn)1 ShortColumn (tech.tablesaw.api.ShortColumn)1 Table (tech.tablesaw.api.Table)1