use of org.apache.lucene.util.SparseFixedBitSet in project lucene-solr by apache.
the class UnicodeProps method createBits.
private static Bits createBits(final int... codepoints) {
final int len = codepoints[codepoints.length - 1] + 1;
final SparseFixedBitSet bitset = new SparseFixedBitSet(len);
for (int i : codepoints) bitset.set(i);
return new Bits() {
@Override
public boolean get(int index) {
return index < len && bitset.get(index);
}
@Override
public int length() {
return 0x10FFFF + 1;
}
};
}
Aggregations