本文整理汇总了Java中it.unimi.dsi.fastutil.ints.IntSet.addAll方法的典型用法代码示例。如果您正苦于以下问题:Java IntSet.addAll方法的具体用法?Java IntSet.addAll怎么用?Java IntSet.addAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类it.unimi.dsi.fastutil.ints.IntSet
的用法示例。
在下文中一共展示了IntSet.addAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compute
import it.unimi.dsi.fastutil.ints.IntSet; //导入方法依赖的package包/类
public void compute() {
ProgressLogger pl = new ProgressLogger(LOGGER, "pages");
pl.expectedUpdates = page2cat.size();
pl.start("Moving old categories to closest milestones...");
for (IntSet entry : page2cat.values()) {
IntSet newCategories = new IntOpenHashSet();
int milestone;
for (int cat : entry) {
milestone = closestMilestones[cat];
if (milestone != -1)
newCategories.add(milestone);
}
entry.clear();
entry.addAll(newCategories);
pl.lightUpdate();
}
pl.done();
}
示例2: testNeighborhood
import it.unimi.dsi.fastutil.ints.IntSet; //导入方法依赖的package包/类
@Test
public void testNeighborhood() {
IntSet in = new IntOpenHashSet(new int[]{2});
IntSet out = new IntOpenHashSet(new int[]{1});
IntSet all = new IntOpenHashSet(out);
all.addAll(in);
IntSet inNeighs = g.getInNeighbours(0);
IntSet outNeighs = g.getOutNeighbours(0);
IntSet neighs = g.getNeighbours(0);
assertEquals(in, inNeighs);
assertEquals(out, outNeighs);
assertEquals(all, neighs);
}
示例3: getEdges
import it.unimi.dsi.fastutil.ints.IntSet; //导入方法依赖的package包/类
@Override
public IntSet getEdges(int n) {
IntSet allEdges = new IntOpenHashSet(this.getInEdges(n));
allEdges.addAll(this.getOutEdges(n));
return allEdges;
}
示例4: getNeighbours
import it.unimi.dsi.fastutil.ints.IntSet; //导入方法依赖的package包/类
@Override
public IntSet getNeighbours(int n) {
IntSet neighs = new IntOpenHashSet(this.getOutNeighbours(n));
neighs.addAll(this.getInNeighbours(n));
return neighs;
}