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


Java Long2ObjectMap.Entry方法代码示例

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


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

示例1: updateAlgorithmStats

import it.unimi.dsi.fastutil.longs.Long2ObjectMap; //导入方法依赖的package包/类
private void updateAlgorithmStats(long queryNode) {
  topSecondDegreeByCountStats.setNumDirectNeighbors(
    leftIndexedBipartiteGraph.getLeftNodeDegree(queryNode)
  );

  int minVisitsPerRightNode = Integer.MAX_VALUE;
  int maxVisitsPerRightNode = 0;
  int numRHSVisits = 0;

  for (Long2ObjectMap.Entry<NodeInfo> entry: visitedRightNodes.long2ObjectEntrySet()) {
    NodeInfo nodeInfo = entry.getValue();
    int numVisits = nodeInfo.getNumVisits();

    minVisitsPerRightNode = Math.min(minVisitsPerRightNode, numVisits);
    maxVisitsPerRightNode = Math.max(maxVisitsPerRightNode, numVisits);
    numRHSVisits += numVisits;
  }

  topSecondDegreeByCountStats.setMinVisitsPerRightNode(minVisitsPerRightNode);
  topSecondDegreeByCountStats.setMaxVisitsPerRightNode(maxVisitsPerRightNode);
  topSecondDegreeByCountStats.setNumRHSVisits(numRHSVisits);
  topSecondDegreeByCountStats.setNumRightNodesReached(visitedRightNodes.size());
}
 
开发者ID:twitter,项目名称:GraphJet,代码行数:24,代码来源:TopSecondDegreeByCount.java

示例2: pairToEntry

import it.unimi.dsi.fastutil.longs.Long2ObjectMap; //导入方法依赖的package包/类
public static Long2ObjectMap.Entry pairToEntry(final LongObjectPair pair) {
  return new Long2ObjectMap.Entry() {
    @Override
    public long getLongKey() {
      return pair.getFirstLong();
    }

    @Override
    public Object getKey() {
      return pair.getFirst();
    }

    @Override
    public Object getValue() {
      return pair.getSecond();
    }

    @Override
    public Object setValue(Object value) {
      throw new UnsupportedOperationException("This entry is immutable");
    }
  };
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:24,代码来源:TuplesUtil.java

示例3: reset

import it.unimi.dsi.fastutil.longs.Long2ObjectMap; //导入方法依赖的package包/类
public void reset() {
  ObjectIterator<Long2ObjectMap.Entry<ByteBuffer>> it = cache.long2ObjectEntrySet().fastIterator();
  while (it.hasNext()) {
    it.next().getValue().clear(); // set position less than limit, make hasRemaining() return true so that it reloads
  }

  inferior.reset();
}
 
开发者ID:geoff-addepar,项目名称:heap-dump,代码行数:9,代码来源:AddressSpace.java

示例4: complete

import it.unimi.dsi.fastutil.longs.Long2ObjectMap; //导入方法依赖的package包/类
@Override
public void complete() {
	LOG.info("{} nodes, {} ways, {} relations", //
			ncounter, wcounter, rcounter);
	Runtime rt = Runtime.getRuntime();
	long used = (rt.totalMemory() - rt.freeMemory()) / 1024 / 1024;
	LOG.info("Memory consumption (before GC): {} MB", used);
	System.gc();
	used = (rt.totalMemory() - rt.freeMemory()) / 1024 / 1024;
	LOG.info("Memory consumption (after GC): {} MB", used);
	LOG.info("Shrinking memory use.");
	// Remove ways which are not needed, mark nodes that we do need.
	ncounter = 0;
	Iterator<Long2ObjectMap.Entry<long[]>> it = ways.long2ObjectEntrySet().iterator();
	while (it.hasNext()) {
		final long[] data = it.next().getValue();
		final int l = data.length - 1;
		if (data[l] == 0L) {
			it.remove();
			--wcounter;
			continue;
		}
		for (int i = 0; i < l; i++) {
			nodemap.put(data[i], Integer.MIN_VALUE);
			ncounter++;
		}
	}
	used = (rt.totalMemory() - rt.freeMemory()) / 1024 / 1024;
	LOG.info("Memory consumption (before GC): {} MB", used);
	System.gc();
	used = (rt.totalMemory() - rt.freeMemory()) / 1024 / 1024;
	LOG.info("Memory consumption (after GC): {} MB", used);
	LOG.info("{} nodes, {} ways, {} relations, nodes to collect: {}",
			ncounter, wcounter, rcounter, nodemap.computeSize());
	if (nodemap.computeSize() == 0) {
		throw new RuntimeException("No nodes to keep.");
	}
}
 
开发者ID:kno10,项目名称:reversegeocode,代码行数:39,代码来源:ParseOSM.java

示例5: next

import it.unimi.dsi.fastutil.longs.Long2ObjectMap; //导入方法依赖的package包/类
@Override
public boolean next() {
    if (!keys.hasNext()) {
        return false;
    }
    final Long2ObjectMap.Entry<IntArrayList> e = keys.next();
    term = e.getLongKey();
    docList = e.getValue();
    // noinspection SimplifiableIfStatement
    if (docList.isEmpty()) return next();
    return true;
}
 
开发者ID:indeedeng,项目名称:imhotep,代码行数:13,代码来源:MemoryFlamdex.java

示例6: writePartition

import it.unimi.dsi.fastutil.longs.Long2ObjectMap; //导入方法依赖的package包/类
@Override
public void writePartition(DataOutput out,
    int partitionId) throws IOException {
  Long2ObjectOpenHashMap<DataInputOutput> partitionMap =
      map.get(partitionId);
  out.writeInt(partitionMap.size());
  ObjectIterator<Long2ObjectMap.Entry<DataInputOutput>> iterator =
      partitionMap.long2ObjectEntrySet().fastIterator();
  while (iterator.hasNext()) {
    Long2ObjectMap.Entry<DataInputOutput> entry = iterator.next();
    out.writeLong(entry.getLongKey());
    entry.getValue().write(out);
  }
}
 
开发者ID:renato2099,项目名称:giraph-gora,代码行数:15,代码来源:LongByteArrayMessageStore.java

示例7: next

import it.unimi.dsi.fastutil.longs.Long2ObjectMap; //导入方法依赖的package包/类
public Long2ObjectMap.Entry<V> next() {
	return nextEntry();
}
 
开发者ID:organicsmarthome,项目名称:OSHv4,代码行数:4,代码来源:Long2ObjectRBNavigableMap.java

示例8: previous

import it.unimi.dsi.fastutil.longs.Long2ObjectMap; //导入方法依赖的package包/类
public Long2ObjectMap.Entry<V> previous() {
	return previousEntry();
}
 
开发者ID:organicsmarthome,项目名称:OSHv4,代码行数:4,代码来源:Long2ObjectRBNavigableMap.java

示例9: set

import it.unimi.dsi.fastutil.longs.Long2ObjectMap; //导入方法依赖的package包/类
public void set(Long2ObjectMap.Entry<V> ok) {
	throw new UnsupportedOperationException();
}
 
开发者ID:organicsmarthome,项目名称:OSHv4,代码行数:4,代码来源:Long2ObjectRBNavigableMap.java

示例10: add

import it.unimi.dsi.fastutil.longs.Long2ObjectMap; //导入方法依赖的package包/类
public void add(Long2ObjectMap.Entry<V> ok) {
	throw new UnsupportedOperationException();
}
 
开发者ID:organicsmarthome,项目名称:OSHv4,代码行数:4,代码来源:Long2ObjectRBNavigableMap.java

示例11: accept

import it.unimi.dsi.fastutil.longs.Long2ObjectMap; //导入方法依赖的package包/类
@Override
public void accept(Long2ObjectMap.Entry<Object> entry) {
	map(currentHandler, entry.getLongKey(), entry.getValue());
}
 
开发者ID:dmart28,项目名称:reveno,代码行数:5,代码来源:ViewsProcessor.java


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