public Topology(SortedSet<Edge> edges) { _edges = new TreeSet<>(edges); _nodeEdges = new HashMap<>(); _interfaceEdges = new HashMap<>(); rebuildFromEdges(); }
/** Removes the specified blacklists from the topology */ public void prune( Set<Edge> blacklistEdges, Set<String> blacklistNodes, Set<NodeInterfacePair> blacklistInterfaces) { if (blacklistEdges != null) { _edges.removeAll(blacklistEdges); } if (blacklistNodes != null) { for (String blacklistNode : blacklistNodes) { _edges.removeAll(_nodeEdges.getOrDefault(blacklistNode, ImmutableSortedSet.of())); } } if (blacklistInterfaces != null) { for (NodeInterfacePair blacklistInterface : blacklistInterfaces) { _edges.removeAll(_interfaceEdges.getOrDefault(blacklistInterface, ImmutableSortedSet.of())); } } rebuildFromEdges(); }