本文整理汇总了Java中it.unimi.dsi.fastutil.ints.Int2ObjectMap.keySet方法的典型用法代码示例。如果您正苦于以下问题:Java Int2ObjectMap.keySet方法的具体用法?Java Int2ObjectMap.keySet怎么用?Java Int2ObjectMap.keySet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类it.unimi.dsi.fastutil.ints.Int2ObjectMap
的用法示例。
在下文中一共展示了Int2ObjectMap.keySet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import it.unimi.dsi.fastutil.ints.Int2ObjectMap; //导入方法依赖的package包/类
private int initialize(Int2ObjectMap<CustomTimeBucket> idToTimeBucket)
{
Preconditions.checkNotNull(idToTimeBucket);
int tempId = Integer.MIN_VALUE;
for (int timeBucketId : idToTimeBucket.keySet()) {
tempId = Math.max(tempId, timeBucketId);
CustomTimeBucket customTimeBucket = idToTimeBucket.get(timeBucketId);
textToTimeBucket.put(customTimeBucket.getText(), customTimeBucket);
Preconditions.checkNotNull(customTimeBucket);
timeBucketToId.put(customTimeBucket, timeBucketId);
}
return tempId;
}
示例2: getWeightedRandomReversed
import it.unimi.dsi.fastutil.ints.Int2ObjectMap; //导入方法依赖的package包/类
@Nullable
public static <T> T getWeightedRandomReversed(Random random, Int2ObjectMap<T> choices)
{
long i = 0;
IntSet ints = choices.keySet();
for (IntIterator iterator = ints.iterator(); iterator.hasNext(); )
{
int x = iterator.nextInt();
i += x;
}
i = getRandomLong(random, 0, i);
for (Int2ObjectMap.Entry<T> entry : choices.int2ObjectEntrySet())
{
i -= entry.getIntKey();
if (i < 0)
{
return entry.getValue();
}
}
return null;
}
示例3: PercentileFTGSCallback
import it.unimi.dsi.fastutil.ints.Int2ObjectMap; //导入方法依赖的package包/类
private PercentileFTGSCallback(final int numStats, final StatReference statRef, final Int2ObjectMap<DoubleList> percentileValues) {
super(numStats);
this.statRef = statRef;
this.percentileValues = percentileValues;
groupToPercentileStats = new Int2ObjectOpenHashMap<LongList>();
for (final int group : percentileValues.keySet()) {
final LongList stats = new LongArrayList();
for (int i = 0; i < percentileValues.get(group).size(); ++i) {
stats.add(Long.MIN_VALUE);
}
groupToPercentileStats.put(group, stats);
}
}