本文整理汇总了Java中org.apache.lucene.util.OpenBitSet.and方法的典型用法代码示例。如果您正苦于以下问题:Java OpenBitSet.and方法的具体用法?Java OpenBitSet.and怎么用?Java OpenBitSet.and使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.lucene.util.OpenBitSet
的用法示例。
在下文中一共展示了OpenBitSet.and方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addFunctionalDependencyIfNotInvalid
import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
public FDTreeElement addFunctionalDependencyIfNotInvalid(OpenBitSet lhs, OpenBitSet rhs) {
FDTreeElement currentNode = this;
currentNode.addRhsAttributes(rhs);
OpenBitSet invalidFds = currentNode.rhsAttributes.clone();
int lhsLength = 0;
for (int i = lhs.nextSetBit(0); i >= 0; i = lhs.nextSetBit(i + 1)) {
lhsLength++;
if (currentNode.getChildren() == null) {
currentNode.setChildren(new FDTreeElement[this.numAttributes]);
currentNode.getChildren()[i] = new FDTreeElement(this.numAttributes);
}
else if (currentNode.getChildren()[i] == null) {
currentNode.getChildren()[i] = new FDTreeElement(this.numAttributes);
}
currentNode = currentNode.getChildren()[i];
invalidFds.and(currentNode.rhsFds);
currentNode.addRhsAttributes(rhs);
}
rhs.andNot(invalidFds);
currentNode.markFds(rhs);
rhs.or(invalidFds);
this.depth = Math.max(this.depth, lhsLength);
return currentNode;
}
示例2: recurseTerms
import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
private void recurseTerms(List<List<TermBitSet>> bitSets, int index, String[] curValues, OpenBitSet curBits,
MatrixResults results, IndexReader reader, boolean countOnly)
{
List<TermBitSet> termBitSetList = bitSets.get(index);
boolean last = index == curValues.length - 1;
for( TermBitSet termBitSet : termBitSetList )
{
OpenBitSet termBits = termBitSet.bitSet;
Term term = termBitSet.term;
// if we don't intersect there's no point in recursing further in
if( curBits.intersects(termBits) )
{
// Collect current term's value into the value array
curValues[index] = term.text();
OpenBitSet docBits = (OpenBitSet) curBits.clone();
docBits.and(termBits);
if( last )
{
int count;
List<ItemIdKey> ids = null;
ArrayList<String> vals = new ArrayList<String>(Arrays.asList(curValues));
if( !countOnly )
{
ids = getIdsForBitset(docBits, reader);
count = ids.size();
}
else
{
count = (int) docBits.cardinality();
}
results.addEntry(new MatrixResults.MatrixEntry(vals, ids, count));
}
else
{
recurseTerms(bitSets, index + 1, curValues, docBits, results, reader, countOnly);
}
}
}
}