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


Java TIntHashSet.contains方法代码示例

本文整理汇总了Java中gnu.trove.TIntHashSet.contains方法的典型用法代码示例。如果您正苦于以下问题:Java TIntHashSet.contains方法的具体用法?Java TIntHashSet.contains怎么用?Java TIntHashSet.contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gnu.trove.TIntHashSet的用法示例。


在下文中一共展示了TIntHashSet.contains方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: mixClassifications

import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
@SuppressWarnings("unused")
private static IClassificationDB mixClassifications(
        IClassificationDB trueClassification,
        IClassificationDB predictedClassification,
        TIntHashSet fromTrueClassification) {
    TroveClassificationDBBuilder builder = new TroveClassificationDBBuilder(
            trueClassification.getDocumentDB(),
            trueClassification.getCategoryDB());

    IIntIterator documents = trueClassification.getDocumentDB()
            .getDocuments();
    while (documents.hasNext()) {
        int document = documents.next();
        if (fromTrueClassification.contains(document))
            copyClassification(document, trueClassification, builder);
        else
            copyClassification(document, predictedClassification, builder);
    }
    return builder.getClassificationDB();
}
 
开发者ID:jatecs,项目名称:jatecs,代码行数:21,代码来源:SATCsimulation.java

示例2: Incremental

import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
public Incremental(int trainSize, ClassificationScoreDB classification, TIntHashSet categoriesFilter,
                   EstimationType estimation, ContingencyTableSet evaluation, IGain gain, IGain firstRankGain, double[] probabilitySlope, double[] prevalencies) {
    super(trainSize, classification, categoriesFilter, estimation, evaluation, firstRankGain, probabilitySlope, prevalencies);
    macroRankTable = new TIntDoubleHashMap((int) (testSize + testSize * 0.25), (float) 0.75);
    microRankTable = new TIntDoubleHashMap((int) (testSize + testSize * 0.25), (float) 0.75);
    macroAlreadySeen = new TIntHashSet((int) (testSize + testSize * 0.25), (float) 0.75);
    microAlreadySeen = new TIntHashSet((int) (testSize + testSize * 0.25), (float) 0.75);
    probabilities = new double[testSize][numOfCategories];
    for (int docId = 0; docId < testSize; docId++) {
        Set<Entry<Short, ClassifierRangeWithScore>> entries = classification.getDocumentScoresAsSet(docId);
        Iterator<Entry<Short, ClassifierRangeWithScore>> iterator = entries.iterator();
        while (iterator.hasNext()) {
            Entry<Short, ClassifierRangeWithScore> next = iterator.next();
            ClassifierRangeWithScore value = next.getValue();
            if (categoriesFilter.contains(next.getKey())) {
                probabilities[docId][catMap.get(next.getKey())] = probability(Math.abs(value.score - value.border), next.getKey());
            }
        }
    }
}
 
开发者ID:jatecs,项目名称:jatecs,代码行数:21,代码来源:Incremental.java

示例3: getSafeToDeleteOutputs

import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
public Collection<String> getSafeToDeleteOutputs(Collection<String> outputPaths, int currentTargetId) throws IOException {
  final int size = outputPaths.size();
  if (size == 0) {
    return outputPaths;
  }
  final Collection<String> result = new ArrayList<String>(size);
  for (String outputPath : outputPaths) {
    final int key = FileUtil.pathHashCode(outputPath);
    synchronized (myDataLock) {
      final TIntHashSet associatedTargets = getState(key);
      if (associatedTargets == null || associatedTargets.size() != 1) {
        continue;
      }
      if (associatedTargets.contains(currentTargetId)) {
        result.add(outputPath);
      }
    }
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:OutputToTargetRegistry.java

示例4: visitPostOrderIterative

import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
private TObjectIntHashMap<Instruction> visitPostOrderIterative(Instruction start, ArrayList<Instruction> instructionsInPostOrderTraversalOfReverseControlFlowGraph) {
	
	TObjectIntHashMap<Instruction>postOrderNumbers = new TObjectIntHashMap<Instruction>();
	
	ArrayList<Instruction> stack = new ArrayList<Instruction>();
	TIntHashSet visitedIndices = new TIntHashSet(code.getNumberOfInstructions());
	TIntHashSet processedIndices = new TIntHashSet(code.getNumberOfInstructions());
	
	stack.add(start);
	while(stack.size() > 0) {
		Instruction top = stack.get(stack.size() - 1);
		if(visitedIndices.contains(top.getIndex())) {
			stack.remove(stack.size() - 1);
			if(!processedIndices.contains(top.getIndex())) {
				processedIndices.add(top.getIndex());
				
				instructionsInPostOrderTraversalOfReverseControlFlowGraph.add(0, top);
				postOrderNumbers.put(top, instructionsInPostOrderTraversalOfReverseControlFlowGraph.size());

			}
		}
		// Remember that we were here, then add the predecessors in reverse order to the stack.
		else {
			visitedIndices.add(top.getIndex());
			int insertionIndex = 0;
			for(Instruction predecessor : top.getOrderedPredecessors()) {
				if(!visitedIndices.contains(predecessor.getIndex())) {
					stack.add(stack.size() - insertionIndex, predecessor);
					insertionIndex++;
				}
			}
		}

	}

	return postOrderNumbers;
	
}
 
开发者ID:andyjko,项目名称:whyline,代码行数:39,代码来源:ControlDependencies.java

示例5: isOrIsSubclassOf

import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
public boolean isOrIsSubclassOf(QualifiedClassName name, QualifiedClassName superclass) {
	
	if(name == null) return false;
	if(name == superclass) return true;
	TIntHashSet subclasses = getSubclassesOf(superclass);
	return subclasses.contains(name.getID());		
	
}
 
开发者ID:andyjko,项目名称:whyline,代码行数:9,代码来源:ClassIDs.java

示例6: drawSoftWrapAwareBackground

import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
private int drawSoftWrapAwareBackground(@NotNull Graphics g,
                                        @Nullable Color backColor,
                                        @Nullable Color prevBackColor,
                                        @NotNull CharSequence text,
                                        int start,
                                        int end,
                                        @NotNull Point position,
                                        @JdkConstants.FontStyle int fontType,
                                        @NotNull Color defaultBackground,
                                        @NotNull Rectangle clip,
                                        @NotNull TIntHashSet softWrapsToSkip,
                                        @NotNull boolean[] caretRowPainted) {
  int startToUse = start;
  // Given 'end' offset is exclusive though SoftWrapModel.getSoftWrapsForRange() uses inclusive end offset.
  // Hence, we decrement it if necessary. Please note that we don't do that if start is equal to end. That is the case,
  // for example, for soft-wrapped collapsed fold region - we need to draw soft wrap before it.
  int softWrapRetrievalEndOffset = end;
  if (end > start) {
    softWrapRetrievalEndOffset--;
  }
  List<? extends SoftWrap> softWraps = getSoftWrapModel().getSoftWrapsForRange(start, softWrapRetrievalEndOffset);
  for (SoftWrap softWrap : softWraps) {
    int softWrapStart = softWrap.getStart();
    if (softWrapsToSkip.contains(softWrapStart)) {
      continue;
    }
    if (startToUse < softWrapStart) {
      position.x = drawBackground(g, backColor, text, startToUse, softWrapStart, position, fontType, defaultBackground, clip);
    }
    boolean drawCustomBackgroundAtSoftWrapVirtualSpace =
      !Comparing.equal(backColor, defaultBackground) && (softWrapStart > start || Comparing.equal(prevBackColor, backColor));
    drawSoftWrap(
      g, softWrap, position, fontType, backColor, drawCustomBackgroundAtSoftWrapVirtualSpace, defaultBackground, clip, caretRowPainted
    );
    startToUse = softWrapStart;
  }

  if (startToUse < end) {
    position.x = drawBackground(g, backColor, text, startToUse, end, position, fontType, defaultBackground, clip);
  }
  return position.x;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:43,代码来源:bigFile.java


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