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


Java TIntObjectIterator.value方法代码示例

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


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

示例1: print

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
@Override
public void print(PrintStream os, Module m)
{
    os.println("**************** Intervals ******************");
    TIntObjectIterator<LiveInterval> itr = slot2LI.iterator();
    while (itr.hasNext())
    {
        int slot = itr.key();
        LiveInterval interval = itr.value();
        interval.print(os, null);
        TargetRegisterClass rc = getIntervalRegClass(slot);
        if (rc != null)
        {
            os.printf("[%s]\n", rc.getName());
        }
        else
        {
            os.println("[unknown]");
        }
    }
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:22,代码来源:LiveStackSlot.java

示例2: process

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
@Override
public void process(@Nonnull final EntityPlayer player) {

	if (this.messages.size() == 0)
		return;

	// Go through the cached messages and get rid of those
	// that expire.
	final int currentTick = EnvironState.getTickCounter();
	final TIntObjectIterator<EntityBubbleContext> entityData = this.messages.iterator();
	while (entityData.hasNext()) {
		entityData.advance();
		final EntityBubbleContext ctx = entityData.value();
		if (ctx.clean(currentTick))
			entityData.remove();
	}
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:18,代码来源:SpeechBubbleHandler.java

示例3: writeTopKBounds

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
public void writeTopKBounds(MultipleOutputs<?, ?> sideOutputs, String outputName, String path, int minsup) throws IOException, InterruptedException {
	final IntWritable itemW  = new IntWritable();
	final IntWritable boundW = new IntWritable();
	
	TIntObjectIterator<PatternWithFreq[]> it = this.topK.iterator();
	
	while (it.hasNext()) {
		it.advance();
		if (it.value()[this.k - 1] != null) {
			final int supportCount = it.value()[this.k - 1].getSupportCount();
			
			if (supportCount > minsup) {
				itemW.set(it.key());
				boundW.set(supportCount);
				sideOutputs.write(outputName, itemW, boundW, path);
			}
		}
	}
}
 
开发者ID:slide-lig,项目名称:TopPI,代码行数:20,代码来源:PerItemTopKHadoopCollector.java

示例4: collectItemStats

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
/**
 * @see infoMode
 */
private void collectItemStats() {
	TIntObjectIterator<PatternWithFreq[]> iterator = this.topK.iterator();

	while (iterator.hasNext()) {
		iterator.advance();

		int item = iterator.key();
		PatternWithFreq[] itemTopK = iterator.value();

		int nbPatterns = 0;
		int supportSum = 0;
		while (nbPatterns < this.k && itemTopK[nbPatterns] != null) {
			supportSum += itemTopK[nbPatterns].getSupportCount();
			nbPatterns++;
		}

		int lowestSupport = itemTopK[nbPatterns - 1].getSupportCount();

		if (itemTopK[0] != null) {
			this.decorated.collect(itemTopK[0].getSupportCount(), new int[] { item, nbPatterns, supportSum,
					lowestSupport });
		}
	}
}
 
开发者ID:slide-lig,项目名称:TopPI,代码行数:28,代码来源:PerItemTopKCollector.java

示例5: tickTimeouts

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
public static void tickTimeouts()
{
    if (++timer >= 200)
    {
        timer = 0;
        int threshold = 30; // 5 minute timeout for non-accessed images
        TIntObjectIterator<ImageHandler> iterator = HANDLERS.iterator();

        for (int i = HANDLERS.size(); i > 0; --i)
        {
            iterator.advance();
            ImageHandler imageHandler = iterator.value();

            if (imageHandler.useSingleTemplateImage == false)
            {
                imageHandler.regionImageCache.removeOld(threshold);
            }
        }
    }
}
 
开发者ID:maruohon,项目名称:paintedbiomes,代码行数:21,代码来源:ImageHandler.java

示例6: normalizeAll

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
/** Normalizes all potentials in the tree, both node and sepset. */
public void normalizeAll()
{
  int n = cpfs.length;
  for (int i = 0; i < n; i++) {
    if (cpfs[i] != null) {
      cpfs[i].normalize();
    }
  }

  TIntObjectIterator it = sepsets.iterator();
  while (it.hasNext()) {
    it.advance();
    Factor ptl = ((Sepset) it.value()).ptl;
    ptl.normalize();
  }
}
 
开发者ID:iamxiatian,项目名称:wikit,代码行数:18,代码来源:JunctionTree.java

示例7: dump

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
public void dump ()
{
  int n = cpfs.length;
  // This will cause OpenJGraph to print all our nodes and edges
  System.out.println(dumpToString());
  // Now lets print all the cpfs
  System.out.println("Vertex CPFs");
  for (int i = 0; i < n; i++) {
    if (cpfs[i] != null) {
      System.out.println("CPF "+i+" "+cpfs[i].dumpToString ());
    }
  }

  // And the sepset potentials
  System.out.println("sepset CPFs");
  TIntObjectIterator it = sepsets.iterator();
  while (it.hasNext()) {
    it.advance();
    Factor ptl = ((Sepset) it.value()).ptl;
    System.out.println(ptl.dumpToString ());
  }
  System.out.println ("/End JT");
}
 
开发者ID:iamxiatian,项目名称:wikit,代码行数:24,代码来源:JunctionTree.java

示例8: isNaN

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
public boolean isNaN()
{
  int n = cpfs.length;
  for (int i = 0; i < n; i++)
    if (cpfs[i].isNaN()) return true;

  // And the sepset potentials
  TIntObjectIterator it = sepsets.iterator();
  while (it.hasNext()) {
    it.advance();
    Factor ptl = ((Sepset) it.value()).ptl;
    if (ptl.isNaN()) return true;
  }

  return false;
}
 
开发者ID:iamxiatian,项目名称:wikit,代码行数:17,代码来源:JunctionTree.java

示例9: dumpMap

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
protected void dumpMap() {
	try {
		tmpFileIndex++;
		String outfile = tmpDIR + "/" + tmpFileIndex + ".tmp";
		logger.info("dumping memory to file: " + outfile);
		PrintStream tmpContentFile = new PrintStream(outfile);
		TIntObjectIterator<T> it = id2item.iterator();
		while (it.hasNext()) {
			it.advance();
			T item = it.value();
			tmpContentFile.print(item.getID());
			tmpContentFile.print("\t");
			tmpContentFile.print(Serialization.serialize(item));
			tmpContentFile.print("\n");
			it.remove();
		}
		tmpContentFile.close();
	} catch (Exception e) {
		logger.error(e.toString());
	}		
}
 
开发者ID:hltfbk,项目名称:Excitement-TDMLEDA,代码行数:22,代码来源:UnlimitedMemoryBasedCountableIdentifiableStorage.java

示例10: writeSimnilarity

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
protected void writeSimnilarity(int element1Id, double element1Score, TIntObjectIterator<ElementSimilarityScoring> it, boolean bR2L) throws SerializationException, IOException, NoScoreFoundException {
	TIntDoubleMap elementsScores = new TIntDoubleHashMap();
	while (it.hasNext()) {
		it.advance();
		int element2Id = it.key();
		if (elementFilter == null || elementFilter.isRelevantElementForCalculation(element2Id)) {
			double element2Score = elementFeatureScoreStorage.getElementScore(element2Id);
			ElementSimilarityScoring similarityScoring = it.value();
			double similarityScore = bR2L ?
						similarityScoring.getSimilarityScore(element2Score, element1Score) :
						similarityScoring.getSimilarityScore(element1Score, element2Score);
			if (similarityScore > 0)
				elementsScores.put(element2Id, similarityScore);
		}
	}
	
	LinkedHashMap<Integer, Double> sortedElementScores = SortUtil.sortMapByValue(elementsScores,true);
	
	if (vectorTruncater != null) 
		sortedElementScores = vectorTruncater.truncate(sortedElementScores);
		
	if (bR2L)
		outR2LDevice.write(element1Id, sortedElementScores);
	else
		outL2RDevice.write(element1Id, sortedElementScores);
}
 
开发者ID:hltfbk,项目名称:Excitement-TDMLEDA,代码行数:27,代码来源:GeneralElementSimilarityCalculator.java

示例11: initialisationComplete

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
@Override
public boolean initialisationComplete(TIndexedCollection<DAGNode> nodes,
		TIndexedCollection<DAGEdge> edges, boolean forceRebuild) {
	if (taggedNodes_ == null) {
		taggedNodes_ = MultiMap.createSortedSetMultiMap();
		TIntObjectIterator<DAGNode> iter = nodes.iterator();
		for (int i = nodes.size(); i-- > 0;) {
			iter.advance();
			DAGNode n = iter.value();
			String[] props = n.getProperties();
			for (String prop : props) {
				if (prop.startsWith(TAG_PREFIX)) {
					taggedNodes_.put(prop, n);
				}
			}
		}
	}
	return super.initialisationComplete(nodes, edges, forceRebuild);
}
 
开发者ID:Effervex,项目名称:DagYo,代码行数:20,代码来源:SubDAGExtractorModule.java

示例12: topologicalList

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
/**
 * Topologically sorts a collection of nodes.
 * 
 * @param nodes
 *            The nodes to sort.
 * @return The topologically sorted list of nodes.
 */
public List<DAGNode> topologicalList(TIndexedCollection<DAGNode> nodes) {
	cycles_ = new ArrayList<>();
	LinkedList<DAGNode> sortedNodes = new LinkedList<>();
	RewriteOfModule rewriteModule = (RewriteOfModule) dag_
			.getModule(RewriteOfModule.class);
	TIntObjectIterator<DAGNode> iter = nodes.iterator();
	for (int i = nodes.size(); i-- > 0;) {
		iter.advance();
		DAGNode n = iter.value();
		if (rewriteModule != null)
			n = rewriteModule.getRewrite(n);
		// Ignore non-collections
		if (queryModule_.prove(false, CommonConcepts.ISA.getNode(dag_), n,
				CommonConcepts.COLLECTION.getNode(dag_)) == QueryResult.TRUE)
			topologicalVisit(n, sortedNodes,
					new HashMap<DAGNode, String>(),
					new ArrayList<DAGNode>());
	}
	return sortedNodes;
}
 
开发者ID:Effervex,项目名称:CycDAG,代码行数:28,代码来源:TransitiveIntervalSchemaModule.java

示例13: iterate

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
void iterate(CellFunction fn) {
	TIntObjectIterator<TIntObjectHashMap<ExchangeCell>> rowIterator = cells
			.iterator();
	while (rowIterator.hasNext()) {
		rowIterator.advance();
		int row = rowIterator.key();
		TIntObjectHashMap<ExchangeCell> rowMap = rowIterator.value();
		if (rowMap == null)
			continue;
		TIntObjectIterator<ExchangeCell> colIterator = rowMap.iterator();
		while (colIterator.hasNext()) {
			colIterator.advance();
			int col = colIterator.key();
			ExchangeCell cell = colIterator.value();
			if (cell == null)
				continue;
			fn.apply(row, col, cell);
		}
	}
}
 
开发者ID:GreenDelta,项目名称:olca-modules,代码行数:21,代码来源:ExchangeMatrix.java

示例14: statisticProb

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
/**
 * 一次性统计概率,节约时间
 */
private void statisticProb() {
	System.out.println("统计概率");
	float totalword = alpahbet.size();
	TIntFloatIterator it = wordProb.iterator();
	while(it.hasNext()){
		it.advance();
		float v = it.value()/totalword;
		it.setValue(v);
		Cluster cluster = new Cluster(it.key(),v,alpahbet.lookupString(it.key()));
		clusters.put(it.key(), cluster);
	}

	TIntObjectIterator<TIntFloatHashMap> it1 = pcc.iterator();
	while(it1.hasNext()){
		it1.advance();
		TIntFloatHashMap map = it1.value();
		TIntFloatIterator it2 = map.iterator();
		while(it2.hasNext()){
			it2.advance();
			it2.setValue(it2.value()/totalword);
		}
	}

}
 
开发者ID:joeywen,项目名称:fudannlp,代码行数:28,代码来源:WordCluster.java

示例15: equals

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
/** {@inheritDoc} */
public boolean equals( Object other ) {
    if ( ! ( other instanceof TIntObjectMap ) ) {
        return false;
    }
    TIntObjectMap that = ( TIntObjectMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TIntObjectIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            int key = iter.key();
            Object value = iter.value();
            if ( value == null ) {
                if ( !( that.get( key ) == null && that.containsKey( key ) ) ) {
                    return false;
                }
            } else {
                if ( !value.equals( that.get( key ) ) ) {
                    return false;
                }
            }
        }
    } catch ( ClassCastException ex ) {
        // unused.
    }
    return true;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:31,代码来源:TIntObjectHashMap.java


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