@Test public void testRemove() { n1.remove(); assertEquals(np.getNodes() , Arrays.asList(n2,n3)); n3.remove(); assertEquals(np.getNodes() , Arrays.asList(n2)); n2.remove(); assertEquals(np.getNodes() , Arrays.asList()); }
public void remove () { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); for (Resource resource : new LinkedList<Resource> (cache_nodeResources)) resource.remove(); for (MulticastTree tree : new LinkedList<MulticastTree> (cache_nodeAssociatedulticastTrees)) tree.remove (); for (Route route : new LinkedList<Route> (cache_nodeAssociatedRoutes)) route.remove (); for (SharedRiskGroup srg : new LinkedList<SharedRiskGroup> (cache_nodeNonDynamicSRGs)) srg.remove (); for (Link link : new LinkedList<Link> (cache_nodeIncomingLinks)) link.remove (); for (Link link : new LinkedList<Link> (cache_nodeOutgoingLinks)) link.remove (); for (Demand demand : new LinkedList<Demand> (cache_nodeIncomingDemands)) demand.remove (); for (Demand demand : new LinkedList<Demand> (cache_nodeOutgoingDemands)) demand.remove (); for (MulticastDemand demand : new LinkedList<MulticastDemand> (cache_nodeIncomingMulticastDemands)) demand.remove (); for (MulticastDemand demand : new LinkedList<MulticastDemand> (cache_nodeOutgoingMulticastDemands)) demand.remove (); netPlan.cache_id2NodeMap.remove (id); for (String tag : tags) netPlan.cache_taggedElements.get(tag).remove(this); NetPlan.removeNetworkElementAndShiftIndexes(netPlan.nodes , this.index); final NetPlan npOld = this.netPlan; removeId(); if (ErrorHandling.isDebugEnabled()) npOld.checkCachesConsistency(); }
Node extends NetworkElement { public void remove () { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); for (Resource resource : new LinkedList<Resource> (cache_nodeResources)) resource.remove(); for (MulticastTree tree : new LinkedList<MulticastTree> (cache_nodeAssociatedulticastTrees)) tree.remove (); for (Route route : new LinkedList<Route> (cache_nodeAssociatedRoutes)) route.remove (); for (SharedRiskGroup srg : new LinkedList<SharedRiskGroup> (cache_nodeNonDynamicSRGs)) srg.remove (); for (Link link : new LinkedList<Link> (cache_nodeIncomingLinks)) link.remove (); for (Link link : new LinkedList<Link> (cache_nodeOutgoingLinks)) link.remove (); for (Demand demand : new LinkedList<Demand> (cache_nodeIncomingDemands)) demand.remove (); for (Demand demand : new LinkedList<Demand> (cache_nodeOutgoingDemands)) demand.remove (); for (MulticastDemand demand : new LinkedList<MulticastDemand> (cache_nodeIncomingMulticastDemands)) demand.remove (); for (MulticastDemand demand : new LinkedList<MulticastDemand> (cache_nodeOutgoingMulticastDemands)) demand.remove (); netPlan.cache_id2NodeMap.remove (id); for (String tag : tags) netPlan.cache_taggedElements.get(tag).remove(this); NetPlan.removeNetworkElementAndShiftIndexes(netPlan.nodes , this.index); final NetPlan npOld = this.netPlan; removeId(); if (ErrorHandling.isDebugEnabled()) npOld.checkCachesConsistency(); } }
Node extends NetworkElement { public void remove () { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); for (Resource resource : new LinkedList<Resource> (cache_nodeResources)) resource.remove(); for (MulticastTree tree : new LinkedList<MulticastTree> (cache_nodeAssociatedulticastTrees)) tree.remove (); for (Route route : new LinkedList<Route> (cache_nodeAssociatedRoutes)) route.remove (); for (SharedRiskGroup srg : new LinkedList<SharedRiskGroup> (cache_nodeNonDynamicSRGs)) srg.remove (); for (Link link : new LinkedList<Link> (cache_nodeIncomingLinks)) link.remove (); for (Link link : new LinkedList<Link> (cache_nodeOutgoingLinks)) link.remove (); for (Demand demand : new LinkedList<Demand> (cache_nodeIncomingDemands)) demand.remove (); for (Demand demand : new LinkedList<Demand> (cache_nodeOutgoingDemands)) demand.remove (); for (MulticastDemand demand : new LinkedList<MulticastDemand> (cache_nodeIncomingMulticastDemands)) demand.remove (); for (MulticastDemand demand : new LinkedList<MulticastDemand> (cache_nodeOutgoingMulticastDemands)) demand.remove (); netPlan.cache_id2NodeMap.remove (id); for (String tag : tags) netPlan.cache_taggedElements.get(tag).remove(this); NetPlan.removeNetworkElementAndShiftIndexes(netPlan.nodes , this.index); final NetPlan npOld = this.netPlan; removeId(); if (ErrorHandling.isDebugEnabled()) npOld.checkCachesConsistency(); } protected  Node(NetPlan netPlan , long id , int index , double xCoord, double yCoord, String name, AttributeMap attributes); }
Node extends NetworkElement { public void remove () { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); for (Resource resource : new LinkedList<Resource> (cache_nodeResources)) resource.remove(); for (MulticastTree tree : new LinkedList<MulticastTree> (cache_nodeAssociatedulticastTrees)) tree.remove (); for (Route route : new LinkedList<Route> (cache_nodeAssociatedRoutes)) route.remove (); for (SharedRiskGroup srg : new LinkedList<SharedRiskGroup> (cache_nodeNonDynamicSRGs)) srg.remove (); for (Link link : new LinkedList<Link> (cache_nodeIncomingLinks)) link.remove (); for (Link link : new LinkedList<Link> (cache_nodeOutgoingLinks)) link.remove (); for (Demand demand : new LinkedList<Demand> (cache_nodeIncomingDemands)) demand.remove (); for (Demand demand : new LinkedList<Demand> (cache_nodeOutgoingDemands)) demand.remove (); for (MulticastDemand demand : new LinkedList<MulticastDemand> (cache_nodeIncomingMulticastDemands)) demand.remove (); for (MulticastDemand demand : new LinkedList<MulticastDemand> (cache_nodeOutgoingMulticastDemands)) demand.remove (); netPlan.cache_id2NodeMap.remove (id); for (String tag : tags) netPlan.cache_taggedElements.get(tag).remove(this); NetPlan.removeNetworkElementAndShiftIndexes(netPlan.nodes , this.index); final NetPlan npOld = this.netPlan; removeId(); if (ErrorHandling.isDebugEnabled()) npOld.checkCachesConsistency(); } protected  Node(NetPlan netPlan , long id , int index , double xCoord, double yCoord, String name, AttributeMap attributes); void setSiteName(String site); String getSiteName(); void setPopulation(double population); double getPopulation(); double getEgressOfferedTraffic(NetworkLayer ... optionalLayerParameter); double getIncomingLinksTraffic(NetworkLayer ... optionalLayerParameter); double getOutgoingLinksTraffic(NetworkLayer ... optionalLayerParameter); double getIncomingLinksCapacity(NetworkLayer ... optionalLayerParameter); double getOutgoingLinksCapacity(NetworkLayer ... optionalLayerParameter); double getIngressOfferedTraffic(NetworkLayer ... optionalLayerParameter); double getEgressOfferedMulticastTraffic(NetworkLayer ... optionalLayerParameter); double getIngressOfferedMulticastTraffic(NetworkLayer ... optionalLayerParameter); void removeAllForwardingRules(NetworkLayer ... optionalLayerParameter); double getEgressCarriedTraffic(NetworkLayer ... optionalLayerParameter); double getIngressCarriedTraffic(NetworkLayer ... optionalLayerParameter); double getEgressCarriedMulticastTraffic(NetworkLayer ... optionalLayerParameter); double getIngressCarriedMulticastTraffic(NetworkLayer ... optionalLayerParameter); SortedSet<Node> getInNeighbors(NetworkLayer ... optionalLayerParameter); SortedSet<Node> getOutNeighbors(NetworkLayer ... optionalLayerParameter); SortedSet<Node> getOutNeighborsAllLayers(); SortedSet<Node> getInNeighborsAllLayers(); Point2D getXYPositionMap(String ...layout); void setXYPositionMap(Point2D pos , String ...layout); boolean isUp(); boolean isDown(); SortedSet<Link> getIncomingLinks(NetworkLayer ... optionalLayerParameter); SortedSet<NetworkLayer> getWorkingLayers(); boolean isWorkingAtLayer(NetworkLayer layer); boolean isIsolated(); SortedSet<Link> getOutgoingLinks(NetworkLayer ... optionalLayerParameter); SortedSet<Link> getOutgoingLinksAllLayers(); SortedSet<Link> getIncomingLinksAllLayers(); SortedSet<Demand> getOutgoingDemandsAllLayers(); SortedSet<Demand> getIncomingDemandsAllLayers(); SortedSet<MulticastDemand> getOutgoingMulticastDemandsAllLayers(); SortedSet<MulticastDemand> getIncomingMulticastDemandsAllLayers(); SortedSet<Demand> getIncomingDemands(NetworkLayer ... optionalLayerParameter); boolean setFailureState(boolean setAsUp); SortedSet<Route> getIncomingRoutes(NetworkLayer ... optionalLayerParameter); SortedSet<MulticastTree> getIncomingMulticastTrees(NetworkLayer ... optionalLayerParameter); SortedSet<Route> getOutgoingRoutes(NetworkLayer ... optionalLayerParameter); SortedSet<MulticastTree> getOutgoingMulticastTrees(NetworkLayer ... optionalLayerParameter); SortedSet<Demand> getOutgoingDemands(NetworkLayer ... optionalLayerParameter); SortedSet<MulticastDemand> getIncomingMulticastDemands(NetworkLayer ... optionalLayerParameter); SortedSet<MulticastDemand> getOutgoingMulticastDemands(NetworkLayer ... optionalLayerParameter); SortedSet<Route> getAssociatedRoutes(NetworkLayer ... optionalLayerParameter); SortedSet<Route> getExpressRoutes(NetworkLayer ... optionalLayerParameter); SortedSet<MulticastTree> getAssociatedMulticastTrees(NetworkLayer ... optionalLayerParameter); SortedSet<SharedRiskGroup> getSRGs(); SortedSet<Resource> getResources(String ... type); void remove(); @Override String toString(); SortedMap<Pair<Demand,Link>,Double> getForwardingRules(NetworkLayer ... optionalLayerParameter); SortedMap<Pair<Demand,Link>,Double> getForwardingRules(Demand demand); URL getUrlNodeIcon(NetworkLayer layer); double getNodeIconRelativeSize(NetworkLayer layer); void setUrlNodeIcon(NetworkLayer layer , URL url , Double relativeSize); void removeUrlNodeIcon(NetworkLayer layer); SortedSet<String> getPlanningDomains(); void removeFromPlanningDomain(String planningDomain); void addToPlanningDomain(String planningDomain); }
Node extends NetworkElement { public void remove () { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); for (Resource resource : new LinkedList<Resource> (cache_nodeResources)) resource.remove(); for (MulticastTree tree : new LinkedList<MulticastTree> (cache_nodeAssociatedulticastTrees)) tree.remove (); for (Route route : new LinkedList<Route> (cache_nodeAssociatedRoutes)) route.remove (); for (SharedRiskGroup srg : new LinkedList<SharedRiskGroup> (cache_nodeNonDynamicSRGs)) srg.remove (); for (Link link : new LinkedList<Link> (cache_nodeIncomingLinks)) link.remove (); for (Link link : new LinkedList<Link> (cache_nodeOutgoingLinks)) link.remove (); for (Demand demand : new LinkedList<Demand> (cache_nodeIncomingDemands)) demand.remove (); for (Demand demand : new LinkedList<Demand> (cache_nodeOutgoingDemands)) demand.remove (); for (MulticastDemand demand : new LinkedList<MulticastDemand> (cache_nodeIncomingMulticastDemands)) demand.remove (); for (MulticastDemand demand : new LinkedList<MulticastDemand> (cache_nodeOutgoingMulticastDemands)) demand.remove (); netPlan.cache_id2NodeMap.remove (id); for (String tag : tags) netPlan.cache_taggedElements.get(tag).remove(this); NetPlan.removeNetworkElementAndShiftIndexes(netPlan.nodes , this.index); final NetPlan npOld = this.netPlan; removeId(); if (ErrorHandling.isDebugEnabled()) npOld.checkCachesConsistency(); } protected  Node(NetPlan netPlan , long id , int index , double xCoord, double yCoord, String name, AttributeMap attributes); void setSiteName(String site); String getSiteName(); void setPopulation(double population); double getPopulation(); double getEgressOfferedTraffic(NetworkLayer ... optionalLayerParameter); double getIncomingLinksTraffic(NetworkLayer ... optionalLayerParameter); double getOutgoingLinksTraffic(NetworkLayer ... optionalLayerParameter); double getIncomingLinksCapacity(NetworkLayer ... optionalLayerParameter); double getOutgoingLinksCapacity(NetworkLayer ... optionalLayerParameter); double getIngressOfferedTraffic(NetworkLayer ... optionalLayerParameter); double getEgressOfferedMulticastTraffic(NetworkLayer ... optionalLayerParameter); double getIngressOfferedMulticastTraffic(NetworkLayer ... optionalLayerParameter); void removeAllForwardingRules(NetworkLayer ... optionalLayerParameter); double getEgressCarriedTraffic(NetworkLayer ... optionalLayerParameter); double getIngressCarriedTraffic(NetworkLayer ... optionalLayerParameter); double getEgressCarriedMulticastTraffic(NetworkLayer ... optionalLayerParameter); double getIngressCarriedMulticastTraffic(NetworkLayer ... optionalLayerParameter); SortedSet<Node> getInNeighbors(NetworkLayer ... optionalLayerParameter); SortedSet<Node> getOutNeighbors(NetworkLayer ... optionalLayerParameter); SortedSet<Node> getOutNeighborsAllLayers(); SortedSet<Node> getInNeighborsAllLayers(); Point2D getXYPositionMap(String ...layout); void setXYPositionMap(Point2D pos , String ...layout); boolean isUp(); boolean isDown(); SortedSet<Link> getIncomingLinks(NetworkLayer ... optionalLayerParameter); SortedSet<NetworkLayer> getWorkingLayers(); boolean isWorkingAtLayer(NetworkLayer layer); boolean isIsolated(); SortedSet<Link> getOutgoingLinks(NetworkLayer ... optionalLayerParameter); SortedSet<Link> getOutgoingLinksAllLayers(); SortedSet<Link> getIncomingLinksAllLayers(); SortedSet<Demand> getOutgoingDemandsAllLayers(); SortedSet<Demand> getIncomingDemandsAllLayers(); SortedSet<MulticastDemand> getOutgoingMulticastDemandsAllLayers(); SortedSet<MulticastDemand> getIncomingMulticastDemandsAllLayers(); SortedSet<Demand> getIncomingDemands(NetworkLayer ... optionalLayerParameter); boolean setFailureState(boolean setAsUp); SortedSet<Route> getIncomingRoutes(NetworkLayer ... optionalLayerParameter); SortedSet<MulticastTree> getIncomingMulticastTrees(NetworkLayer ... optionalLayerParameter); SortedSet<Route> getOutgoingRoutes(NetworkLayer ... optionalLayerParameter); SortedSet<MulticastTree> getOutgoingMulticastTrees(NetworkLayer ... optionalLayerParameter); SortedSet<Demand> getOutgoingDemands(NetworkLayer ... optionalLayerParameter); SortedSet<MulticastDemand> getIncomingMulticastDemands(NetworkLayer ... optionalLayerParameter); SortedSet<MulticastDemand> getOutgoingMulticastDemands(NetworkLayer ... optionalLayerParameter); SortedSet<Route> getAssociatedRoutes(NetworkLayer ... optionalLayerParameter); SortedSet<Route> getExpressRoutes(NetworkLayer ... optionalLayerParameter); SortedSet<MulticastTree> getAssociatedMulticastTrees(NetworkLayer ... optionalLayerParameter); SortedSet<SharedRiskGroup> getSRGs(); SortedSet<Resource> getResources(String ... type); void remove(); @Override String toString(); SortedMap<Pair<Demand,Link>,Double> getForwardingRules(NetworkLayer ... optionalLayerParameter); SortedMap<Pair<Demand,Link>,Double> getForwardingRules(Demand demand); URL getUrlNodeIcon(NetworkLayer layer); double getNodeIconRelativeSize(NetworkLayer layer); void setUrlNodeIcon(NetworkLayer layer , URL url , Double relativeSize); void removeUrlNodeIcon(NetworkLayer layer); SortedSet<String> getPlanningDomains(); void removeFromPlanningDomain(String planningDomain); void addToPlanningDomain(String planningDomain);  }