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

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

本文整理了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

/** Build a {@link BitSet} from the content of the provided {@link DocIdSetIterator}.
 *  NOTE: this will fully consume the {@link DocIdSetIterator}. */
public static BitSet of(DocIdSetIterator it, int maxDoc) throws IOException {
 final long cost = it.cost();
 final int threshold = maxDoc >>> 7;
 BitSet set;
 if (cost < threshold) {
  set = new SparseFixedBitSet(maxDoc);
 } else {
  set = new FixedBitSet(maxDoc);
 }
 set.or(it);
 return set;
}

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

@Override
public void or(DocIdSetIterator iter) throws IOException {
 if (BitSetIterator.getFixedBitSetOrNull(iter) != null) {
  checkUnpositioned(iter);
  final FixedBitSet bits = BitSetIterator.getFixedBitSetOrNull(iter); 
  or(bits);
 } else {
  super.or(iter);
 }
}

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

@Override
public void or(DocIdSetIterator it) throws IOException {
 {
  // specialize union with another SparseFixedBitSet
  final SparseFixedBitSet other = BitSetIterator.getSparseFixedBitSetOrNull(it);
  if (other != null) {
   checkUnpositioned(it);
   or(other);
   return;
  }
 }
 // We do not specialize the union with a FixedBitSet since FixedBitSets are
 // supposed to be used for dense data and sparse fixed bit sets for sparse
 // data, so a sparse set would likely get upgraded by DocIdSetBuilder before
 // being or'ed with a FixedBitSet
 if (it.cost() < indices.length) {
  // the default impl is good for sparse iterators
  super.or(it);
 } else {
  orDense(it);
 }
}

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

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

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

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

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

/** Build a {@link BitSet} from the content of the provided {@link DocIdSetIterator}.
 *  NOTE: this will fully consume the {@link DocIdSetIterator}. */
public static BitSet of(DocIdSetIterator it, int maxDoc) throws IOException {
 final long cost = it.cost();
 final int threshold = maxDoc >>> 7;
 BitSet set;
 if (cost < threshold) {
  set = new SparseFixedBitSet(maxDoc);
 } else {
  set = new FixedBitSet(maxDoc);
 }
 set.or(it);
 return set;
}

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

/** Build a {@link BitSet} from the content of the provided {@link DocIdSetIterator}.
 *  NOTE: this will fully consume the {@link DocIdSetIterator}. */
public static BitSet of(DocIdSetIterator it, int maxDoc) throws IOException {
 final long cost = it.cost();
 final int threshold = maxDoc >>> 7;
 BitSet set;
 if (cost < threshold) {
  set = new SparseFixedBitSet(maxDoc);
 } else {
  set = new FixedBitSet(maxDoc);
 }
 set.or(it);
 return set;
}

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

/** Build a {@link BitSet} from the content of the provided {@link DocIdSetIterator}.
 *  NOTE: this will fully consume the {@link DocIdSetIterator}. */
public static BitSet of(DocIdSetIterator it, int maxDoc) throws IOException {
 final long cost = it.cost();
 final int threshold = maxDoc >>> 7;
 BitSet set;
 if (cost < threshold) {
  set = new SparseFixedBitSet(maxDoc);
 } else {
  set = new FixedBitSet(maxDoc);
 }
 set.or(it);
 return set;
}

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

@Override
public void or(DocIdSetIterator iter) throws IOException {
 if (BitSetIterator.getFixedBitSetOrNull(iter) != null) {
  assertUnpositioned(iter);
  final FixedBitSet bits = BitSetIterator.getFixedBitSetOrNull(iter); 
  or(bits);
 } else {
  super.or(iter);
 }
}

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

@Override
public void or(DocIdSetIterator iter) throws IOException {
 if (BitSetIterator.getFixedBitSetOrNull(iter) != null) {
  checkUnpositioned(iter);
  final FixedBitSet bits = BitSetIterator.getFixedBitSetOrNull(iter); 
  or(bits);
 } else {
  super.or(iter);
 }
}

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

@Override
public void or(DocIdSetIterator iter) throws IOException {
 if (BitSetIterator.getFixedBitSetOrNull(iter) != null) {
  assertUnpositioned(iter);
  final FixedBitSet bits = BitSetIterator.getFixedBitSetOrNull(iter); 
  or(bits);
 } else {
  super.or(iter);
 }
}

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

@Override
public void or(DocIdSetIterator it) throws IOException {
 {
  // specialize union with another SparseFixedBitSet
  final SparseFixedBitSet other = BitSetIterator.getSparseFixedBitSetOrNull(it);
  if (other != null) {
   checkUnpositioned(it);
   or(other);
   return;
  }
 }
 // We do not specialize the union with a FixedBitSet since FixedBitSets are
 // supposed to be used for dense data and sparse fixed bit sets for sparse
 // data, so a sparse set would likely get upgraded by DocIdSetBuilder before
 // being or'ed with a FixedBitSet
 if (it.cost() < indices.length) {
  // the default impl is good for sparse iterators
  super.or(it);
 } else {
  orDense(it);
 }
}

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

@Override
public void or(DocIdSetIterator it) throws IOException {
 {
  // specialize union with another SparseFixedBitSet
  final SparseFixedBitSet other = BitSetIterator.getSparseFixedBitSetOrNull(it);
  if (other != null) {
   assertUnpositioned(it);
   or(other);
   return;
  }
 }
 // We do not specialize the union with a FixedBitSet since FixedBitSets are
 // supposed to be used for dense data and sparse fixed bit sets for sparse
 // data, so a sparse set would likely get upgraded by DocIdSetBuilder before
 // being or'ed with a FixedBitSet
 if (it.cost() < indices.length) {
  // the default impl is good for sparse iterators
  super.or(it);
 } else {
  orDense(it);
 }
}

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

@Override
public void or(DocIdSetIterator it) throws IOException {
 {
  // specialize union with another SparseFixedBitSet
  final SparseFixedBitSet other = BitSetIterator.getSparseFixedBitSetOrNull(it);
  if (other != null) {
   assertUnpositioned(it);
   or(other);
   return;
  }
 }
 // We do not specialize the union with a FixedBitSet since FixedBitSets are
 // supposed to be used for dense data and sparse fixed bit sets for sparse
 // data, so a sparse set would likely get upgraded by DocIdSetBuilder before
 // being or'ed with a FixedBitSet
 if (it.cost() < indices.length) {
  // the default impl is good for sparse iterators
  super.or(it);
 } else {
  orDense(it);
 }
}

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

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

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

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

相关文章