当前位置: 首页>>代码示例>>Java>>正文


Java OpenBitSet.and方法代码示例

本文整理汇总了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;
}
 
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:30,代码来源:FDTree.java

示例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);
			}
		}
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:40,代码来源:ItemIndex.java


注:本文中的org.apache.lucene.util.OpenBitSet.and方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。