Search in sources :

Example 16 with Selection

use of tech.tablesaw.selection.Selection in project symja_android_library by axkr.

the class ByteDictionaryMap method selectIsIn.

@Override
public Selection selectIsIn(String... strings) {
    ByteOpenHashSet keys = new ByteOpenHashSet();
    for (String string : strings) {
        byte key = getKeyForValue(string);
        if (key != DEFAULT_RETURN_VALUE) {
            keys.add(key);
        }
    }
    Selection results = new BitmapBackedSelection();
    for (int i = 0; i < values.size(); i++) {
        if (keys.contains(values.getByte(i))) {
            results.add(i);
        }
    }
    return results;
}
Also used : BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection) Selection(tech.tablesaw.selection.Selection) BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection) ByteOpenHashSet(it.unimi.dsi.fastutil.bytes.ByteOpenHashSet)

Example 17 with Selection

use of tech.tablesaw.selection.Selection in project symja_android_library by axkr.

the class ByteDictionaryMap method selectIsIn.

@Override
public Selection selectIsIn(Collection<String> strings) {
    ByteOpenHashSet keys = new ByteOpenHashSet();
    for (String string : strings) {
        byte key = getKeyForValue(string);
        if (key != DEFAULT_RETURN_VALUE) {
            keys.add(key);
        }
    }
    Selection results = new BitmapBackedSelection();
    for (int i = 0; i < values.size(); i++) {
        if (keys.contains(values.getByte(i))) {
            results.add(i);
        }
    }
    return results;
}
Also used : BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection) Selection(tech.tablesaw.selection.Selection) BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection) ByteOpenHashSet(it.unimi.dsi.fastutil.bytes.ByteOpenHashSet)

Example 18 with Selection

use of tech.tablesaw.selection.Selection in project symja_android_library by axkr.

the class DictionaryMap method isNotEqualTo.

default Selection isNotEqualTo(String string) {
    Selection selection = new BitmapBackedSelection();
    selection.addRange(0, size());
    selection.andNot(isEqualTo(string));
    return selection;
}
Also used : BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection) Selection(tech.tablesaw.selection.Selection) BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection)

Example 19 with Selection

use of tech.tablesaw.selection.Selection in project symja_android_library by axkr.

the class TimeFilters method isEqualTo.

default Selection isEqualTo(LocalTime value) {
    Selection results = new BitmapBackedSelection();
    int packedLocalTime = PackedLocalTime.pack(value);
    for (int i = 0; i < size(); i++) {
        if (packedLocalTime == getIntInternal(i)) {
            results.add(i);
        }
    }
    return results;
}
Also used : BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection) Selection(tech.tablesaw.selection.Selection) BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection)

Example 20 with Selection

use of tech.tablesaw.selection.Selection in project symja_android_library by axkr.

the class ShortDictionaryMap method selectIsIn.

@Override
public Selection selectIsIn(Collection<String> strings) {
    ShortOpenHashSet keys = new ShortOpenHashSet(strings.size());
    for (String string : strings) {
        short key = getKeyForValue(string);
        if (key != DEFAULT_RETURN_VALUE) {
            keys.add(key);
        }
    }
    Selection results = new BitmapBackedSelection();
    for (int i = 0; i < values.size(); i++) {
        if (keys.contains(values.getShort(i))) {
            results.add(i);
        }
    }
    return results;
}
Also used : BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection) Selection(tech.tablesaw.selection.Selection) BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection) ShortOpenHashSet(it.unimi.dsi.fastutil.shorts.ShortOpenHashSet)

Aggregations

Selection (tech.tablesaw.selection.Selection)85 BitmapBackedSelection (tech.tablesaw.selection.BitmapBackedSelection)80 IntArrayList (it.unimi.dsi.fastutil.ints.IntArrayList)31 PivotTable (tech.tablesaw.aggregate.PivotTable)3 BooleanColumn (tech.tablesaw.api.BooleanColumn)3 ByteOpenHashSet (it.unimi.dsi.fastutil.bytes.ByteOpenHashSet)2 IntIterator (it.unimi.dsi.fastutil.ints.IntIterator)2 IntOpenHashSet (it.unimi.dsi.fastutil.ints.IntOpenHashSet)2 ShortOpenHashSet (it.unimi.dsi.fastutil.shorts.ShortOpenHashSet)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 IExpr (org.matheclipse.core.interfaces.IExpr)2 ByteArrayList (it.unimi.dsi.fastutil.bytes.ByteArrayList)1 ByteIterator (it.unimi.dsi.fastutil.bytes.ByteIterator)1 IntRBTreeSet (it.unimi.dsi.fastutil.ints.IntRBTreeSet)1 ByteBuffer (java.nio.ByteBuffer)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 CategoricalColumn (tech.tablesaw.api.CategoricalColumn)1 DoubleColumn (tech.tablesaw.api.DoubleColumn)1 Column (tech.tablesaw.columns.Column)1