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


Java Long2LongMap.Entry方法代码示例

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


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

示例1: pickUpSampling

import it.unimi.dsi.fastutil.longs.Long2LongMap; //导入方法依赖的package包/类
private int pickUpSampling(long seconds, long start, int last, Long2LongMap buckets) {
    if (seconds < start) {
        return 1;
    }
    long sample = 0;
    for (Long2LongMap.Entry e : buckets.long2LongEntrySet()) {
        if (seconds < e.getLongKey()) {
            sample = e.getLongValue();
            break;
        }
    }
    if (sample == 0) {
        return last;
    }
    return (int) sample;
}
 
开发者ID:dmart28,项目名称:gcplot,代码行数:17,代码来源:DefaultAnalyticsService.java

示例2: computeNewLabel

import it.unimi.dsi.fastutil.longs.Long2LongMap; //导入方法依赖的package包/类
private long computeNewLabel(Node node) {
	// Count the frequency of labels at neighbours of the current node
	labelCounts.clear();
	labelCounts.defaultReturnValue(0L);
	for (Relationship relationship : node.getRelationships(EDGE, Direction.BOTH)) {
		long otherLabel = labels.get(relationship.getOtherNode(node));
		labelCounts.put(otherLabel, labelCounts.get(otherLabel) + 1);
	}

	// Find the most frequent label with the lowest id
	long bestLabel = labels.get(node);
	long bestFrequency = 0;
	for (Long2LongMap.Entry labelFrequencyPair : labelCounts.long2LongEntrySet()) {
		long nextLabel = labelFrequencyPair.getLongKey();
		long nextFrequency = labelFrequencyPair.getLongValue();
		if (nextFrequency > bestFrequency) {
			bestLabel = nextLabel;
			bestFrequency = nextFrequency;
		} else if (nextFrequency == bestFrequency && nextLabel < bestLabel) {
			bestLabel = nextLabel;
		}
	}
	return bestLabel;
}
 
开发者ID:atlarge-research,项目名称:graphalytics-platforms-neo4j,代码行数:25,代码来源:CommunityDetectionLPComputation.java

示例3: contains

import it.unimi.dsi.fastutil.longs.Long2LongMap; //导入方法依赖的package包/类
@Override
public boolean contains(long address) {
    if (indexedMemoryAccessChecker != null) {
        int result = indexedMemoryAccessChecker.isAllocated(address);
        if (result == IndexedMemoryAccessChecker.ALLOCATED) {
            return true;
        } else if (result == IndexedMemoryAccessChecker.NOT_ALLOCATED) {
            return false;
        }
        // Not indexed, so check over allocated memories
    }
    Long2LongMap.Entry entry = allocatedMemories.tailMap(address).long2LongEntrySet().first();
    if (entry == null) {
        return false;
    }
    long startAddress = entry.getLongKey();
    long endAddress = startAddress + entry.getLongValue();
    return address >= startAddress && address <= endAddress;
}
 
开发者ID:serkan-ozal,项目名称:mysafe,代码行数:20,代码来源:ThreadLocalNavigatableAllocatedMemoryStorage.java


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