org.apache.lucene.util.BitSet.or()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中org.apache.lucene.util.BitSet.or()方法的一些代码示例,展示了BitSet.or()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BitSet.or()方法的具体详情如下:
包路径:org.apache.lucene.util.BitSet
类名称:BitSet
方法名:or

BitSet.or介绍

[英]Does in-place OR of the bits provided by the iterator. The state of the iterator after this operation terminates is undefined.
[中]代替迭代器提供的位执行或。此操作终止后迭代器的状态未定义。

代码示例

代码示例来源:origin: org.apache.lucene/lucene-core

  1. /** Build a {@link BitSet} from the content of the provided {@link DocIdSetIterator}.
  2. * NOTE: this will fully consume the {@link DocIdSetIterator}. */
  3. public static BitSet of(DocIdSetIterator it, int maxDoc) throws IOException {
  4. final long cost = it.cost();
  5. final int threshold = maxDoc >>> 7;
  6. BitSet set;
  7. if (cost < threshold) {
  8. set = new SparseFixedBitSet(maxDoc);
  9. } else {
  10. set = new FixedBitSet(maxDoc);
  11. }
  12. set.or(it);
  13. return set;
  14. }

代码示例来源:origin: org.apache.lucene/lucene-core

  1. @Override
  2. public void or(DocIdSetIterator iter) throws IOException {
  3. if (BitSetIterator.getFixedBitSetOrNull(iter) != null) {
  4. checkUnpositioned(iter);
  5. final FixedBitSet bits = BitSetIterator.getFixedBitSetOrNull(iter);
  6. or(bits);
  7. } else {
  8. super.or(iter);
  9. }
  10. }

代码示例来源:origin: org.apache.lucene/lucene-core

  1. @Override
  2. public void or(DocIdSetIterator it) throws IOException {
  3. {
  4. // specialize union with another SparseFixedBitSet
  5. final SparseFixedBitSet other = BitSetIterator.getSparseFixedBitSetOrNull(it);
  6. if (other != null) {
  7. checkUnpositioned(it);
  8. or(other);
  9. return;
  10. }
  11. }
  12. // We do not specialize the union with a FixedBitSet since FixedBitSets are
  13. // supposed to be used for dense data and sparse fixed bit sets for sparse
  14. // data, so a sparse set would likely get upgraded by DocIdSetBuilder before
  15. // being or'ed with a FixedBitSet
  16. if (it.cost() < indices.length) {
  17. // the default impl is good for sparse iterators
  18. super.or(it);
  19. } else {
  20. orDense(it);
  21. }
  22. }

代码示例来源:origin: org.apache.lucene/lucene-spatial-extras

  1. protected void collectDocs(BitSet bitSet) throws IOException {
  2. assert termsEnum != null;
  3. postingsEnum = termsEnum.postings(postingsEnum, PostingsEnum.NONE);
  4. bitSet.or(postingsEnum);
  5. }

代码示例来源:origin: harbby/presto-connectors

  1. protected void collectDocs(BitSet bitSet) throws IOException {
  2. assert termsEnum != null;
  3. postingsEnum = termsEnum.postings(postingsEnum, PostingsEnum.NONE);
  4. bitSet.or(postingsEnum);
  5. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

  1. /** Build a {@link BitSet} from the content of the provided {@link DocIdSetIterator}.
  2. * NOTE: this will fully consume the {@link DocIdSetIterator}. */
  3. public static BitSet of(DocIdSetIterator it, int maxDoc) throws IOException {
  4. final long cost = it.cost();
  5. final int threshold = maxDoc >>> 7;
  6. BitSet set;
  7. if (cost < threshold) {
  8. set = new SparseFixedBitSet(maxDoc);
  9. } else {
  10. set = new FixedBitSet(maxDoc);
  11. }
  12. set.or(it);
  13. return set;
  14. }

代码示例来源:origin: harbby/presto-connectors

  1. /** Build a {@link BitSet} from the content of the provided {@link DocIdSetIterator}.
  2. * NOTE: this will fully consume the {@link DocIdSetIterator}. */
  3. public static BitSet of(DocIdSetIterator it, int maxDoc) throws IOException {
  4. final long cost = it.cost();
  5. final int threshold = maxDoc >>> 7;
  6. BitSet set;
  7. if (cost < threshold) {
  8. set = new SparseFixedBitSet(maxDoc);
  9. } else {
  10. set = new FixedBitSet(maxDoc);
  11. }
  12. set.or(it);
  13. return set;
  14. }

代码示例来源:origin: org.infinispan/infinispan-embedded-query

  1. /** Build a {@link BitSet} from the content of the provided {@link DocIdSetIterator}.
  2. * NOTE: this will fully consume the {@link DocIdSetIterator}. */
  3. public static BitSet of(DocIdSetIterator it, int maxDoc) throws IOException {
  4. final long cost = it.cost();
  5. final int threshold = maxDoc >>> 7;
  6. BitSet set;
  7. if (cost < threshold) {
  8. set = new SparseFixedBitSet(maxDoc);
  9. } else {
  10. set = new FixedBitSet(maxDoc);
  11. }
  12. set.or(it);
  13. return set;
  14. }

代码示例来源:origin: harbby/presto-connectors

  1. @Override
  2. public void or(DocIdSetIterator iter) throws IOException {
  3. if (BitSetIterator.getFixedBitSetOrNull(iter) != null) {
  4. assertUnpositioned(iter);
  5. final FixedBitSet bits = BitSetIterator.getFixedBitSetOrNull(iter);
  6. or(bits);
  7. } else {
  8. super.or(iter);
  9. }
  10. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

  1. @Override
  2. public void or(DocIdSetIterator iter) throws IOException {
  3. if (BitSetIterator.getFixedBitSetOrNull(iter) != null) {
  4. checkUnpositioned(iter);
  5. final FixedBitSet bits = BitSetIterator.getFixedBitSetOrNull(iter);
  6. or(bits);
  7. } else {
  8. super.or(iter);
  9. }
  10. }

代码示例来源:origin: org.infinispan/infinispan-embedded-query

  1. @Override
  2. public void or(DocIdSetIterator iter) throws IOException {
  3. if (BitSetIterator.getFixedBitSetOrNull(iter) != null) {
  4. assertUnpositioned(iter);
  5. final FixedBitSet bits = BitSetIterator.getFixedBitSetOrNull(iter);
  6. or(bits);
  7. } else {
  8. super.or(iter);
  9. }
  10. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

  1. @Override
  2. public void or(DocIdSetIterator it) throws IOException {
  3. {
  4. // specialize union with another SparseFixedBitSet
  5. final SparseFixedBitSet other = BitSetIterator.getSparseFixedBitSetOrNull(it);
  6. if (other != null) {
  7. checkUnpositioned(it);
  8. or(other);
  9. return;
  10. }
  11. }
  12. // We do not specialize the union with a FixedBitSet since FixedBitSets are
  13. // supposed to be used for dense data and sparse fixed bit sets for sparse
  14. // data, so a sparse set would likely get upgraded by DocIdSetBuilder before
  15. // being or'ed with a FixedBitSet
  16. if (it.cost() < indices.length) {
  17. // the default impl is good for sparse iterators
  18. super.or(it);
  19. } else {
  20. orDense(it);
  21. }
  22. }

代码示例来源:origin: org.infinispan/infinispan-embedded-query

  1. @Override
  2. public void or(DocIdSetIterator it) throws IOException {
  3. {
  4. // specialize union with another SparseFixedBitSet
  5. final SparseFixedBitSet other = BitSetIterator.getSparseFixedBitSetOrNull(it);
  6. if (other != null) {
  7. assertUnpositioned(it);
  8. or(other);
  9. return;
  10. }
  11. }
  12. // We do not specialize the union with a FixedBitSet since FixedBitSets are
  13. // supposed to be used for dense data and sparse fixed bit sets for sparse
  14. // data, so a sparse set would likely get upgraded by DocIdSetBuilder before
  15. // being or'ed with a FixedBitSet
  16. if (it.cost() < indices.length) {
  17. // the default impl is good for sparse iterators
  18. super.or(it);
  19. } else {
  20. orDense(it);
  21. }
  22. }

代码示例来源:origin: harbby/presto-connectors

  1. @Override
  2. public void or(DocIdSetIterator it) throws IOException {
  3. {
  4. // specialize union with another SparseFixedBitSet
  5. final SparseFixedBitSet other = BitSetIterator.getSparseFixedBitSetOrNull(it);
  6. if (other != null) {
  7. assertUnpositioned(it);
  8. or(other);
  9. return;
  10. }
  11. }
  12. // We do not specialize the union with a FixedBitSet since FixedBitSets are
  13. // supposed to be used for dense data and sparse fixed bit sets for sparse
  14. // data, so a sparse set would likely get upgraded by DocIdSetBuilder before
  15. // being or'ed with a FixedBitSet
  16. if (it.cost() < indices.length) {
  17. // the default impl is good for sparse iterators
  18. super.or(it);
  19. } else {
  20. orDense(it);
  21. }
  22. }

代码示例来源:origin: org.infinispan/infinispan-embedded-query

  1. bitSet.or(iter);
  2. } else {
  3. while (true) {

代码示例来源:origin: harbby/presto-connectors

  1. bitSet.or(iter);
  2. } else {
  3. while (true) {

相关文章