Java 类it.unimi.dsi.fastutil.ints.IntSets 实例源码

项目:llamafur    文件:IntMapGraph.java   
public IntMapGraph(Int2ObjectMap<IntSet> map) {
    this.map = map;
    if (map.defaultReturnValue() == null || !map.defaultReturnValue().equals(IntSets.EMPTY_SET)) {
        LOGGER.warn("It is necessary to set default return value of the map as the empty set.");
        map.defaultReturnValue(IntSets.EMPTY_SET);
    }

    int maxNodeIndex = 0, numArcs = 0;
    for (Entry<IntSet> x : map.int2ObjectEntrySet()) {
        if (x.getIntKey() > maxNodeIndex)
            maxNodeIndex = x.getIntKey();
        for (int succ : x.getValue()) {
            if (succ > maxNodeIndex)
                maxNodeIndex = succ;
            numArcs++;
        }
    }

    this.numArcs  = numArcs;
    this.numNodes = maxNodeIndex+1;
}
项目:BungeeTabListPlus    文件:Object2IntHashMultimap.java   
public IntCollection get(T key) {
    return map.getOrDefault(key, IntSets.EMPTY_SET);
}
项目:elki    文件:DeLiCluTree.java   
/**
 * Returns the nodes which are already expanded with the specified node.
 *
 * @param entry the id of the node for which the expansions should be returned
 * @return the nodes which are already expanded with the specified node
 */
public IntSet getExpanded(SpatialEntry entry) {
  IntSet exp = expanded.get(getPageID(entry));
  return (exp != null) ? exp : IntSets.EMPTY_SET;
}
项目:elki    文件:DeLiCluTree.java   
/**
 * Returns the nodes which are already expanded with the specified node.
 *
 * @param entry the id of the node for which the expansions should be returned
 * @return the nodes which are already expanded with the specified node
 */
public IntSet getExpanded(DeLiCluNode entry) {
  IntSet exp = expanded.get(entry.getPageID());
  return (exp != null) ? exp : IntSets.EMPTY_SET;
}