本文整理汇总了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());
}
示例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");
}
};
}
示例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();
}
示例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.");
}
}
示例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;
}
示例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);
}
}
示例7: next
import it.unimi.dsi.fastutil.longs.Long2ObjectMap; //导入方法依赖的package包/类
public Long2ObjectMap.Entry<V> next() {
return nextEntry();
}
示例8: previous
import it.unimi.dsi.fastutil.longs.Long2ObjectMap; //导入方法依赖的package包/类
public Long2ObjectMap.Entry<V> previous() {
return previousEntry();
}
示例9: set
import it.unimi.dsi.fastutil.longs.Long2ObjectMap; //导入方法依赖的package包/类
public void set(Long2ObjectMap.Entry<V> ok) {
throw new UnsupportedOperationException();
}
示例10: add
import it.unimi.dsi.fastutil.longs.Long2ObjectMap; //导入方法依赖的package包/类
public void add(Long2ObjectMap.Entry<V> ok) {
throw new UnsupportedOperationException();
}
示例11: accept
import it.unimi.dsi.fastutil.longs.Long2ObjectMap; //导入方法依赖的package包/类
@Override
public void accept(Long2ObjectMap.Entry<Object> entry) {
map(currentHandler, entry.getLongKey(), entry.getValue());
}