use of it.unimi.dsi.fastutil.shorts.ShortOpenHashSet in project symja_android_library by axkr.
the class ShortColumn method unique.
@Override
public ShortColumn unique() {
final ShortSet values = new ShortOpenHashSet();
for (int i = 0; i < size(); i++) {
values.add(getShort(i));
}
final ShortColumn column = ShortColumn.create(name() + " Unique values");
for (short value : values) {
column.append(value);
}
return column;
}
use of it.unimi.dsi.fastutil.shorts.ShortOpenHashSet 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;
}
use of it.unimi.dsi.fastutil.shorts.ShortOpenHashSet in project symja_android_library by axkr.
the class ShortDictionaryMap method selectIsIn.
@Override
public Selection selectIsIn(String... strings) {
ShortOpenHashSet keys = new ShortOpenHashSet(strings.length);
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;
}
Aggregations