use of tech.tablesaw.selection.Selection in project symja_android_library by axkr.
the class IntDictionaryMap method selectIsIn.
@Override
public Selection selectIsIn(Collection<String> strings) {
IntOpenHashSet keys = new IntOpenHashSet(strings.size());
for (String string : strings) {
int 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.getInt(i))) {
results.add(i);
}
}
return results;
}
use of tech.tablesaw.selection.Selection in project symja_android_library by axkr.
the class StringFilters method isNotEqualTo.
default Selection isNotEqualTo(String string) {
Selection selection = new BitmapBackedSelection();
selection.addRange(0, size());
selection.andNot(isEqualTo(string));
return selection;
}
use of tech.tablesaw.selection.Selection 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());
}
use of tech.tablesaw.selection.Selection 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());
}
use of tech.tablesaw.selection.Selection in project symja_android_library by axkr.
the class DateFilters method eval.
default Selection eval(IntBiPredicate predicate, int value) {
Selection selection = new BitmapBackedSelection();
IntIterator iterator = intIterator();
int idx = 0;
while (iterator.hasNext()) {
int next = iterator.nextInt();
if (predicate.test(next, value)) {
selection.add(idx);
}
idx++;
}
return selection;
}
Aggregations