Class ContainerNodeUpdateUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic GridContainerupdateGridWithNodes(GridContainer grid, Map<NodeInput, NodeInput> oldToNewNodes) Updates the providedGridContainerwith the provided mapping of old to newNodeInputentities.static JointGridContainerupdateGridWithNodes(JointGridContainer grid, Map<NodeInput, NodeInput> oldToNewNodes) Updates the providedJointGridContainerwith the provided mapping of old to newNodeInputentities.static SubGridContainerupdateGridWithNodes(SubGridContainer grid, Map<NodeInput, NodeInput> oldToNewNodes) Updates the providedSubGridContainerwith the provided mapping of old to newNodeInputentities.
-
Method Details
-
updateGridWithNodes
public static GridContainer updateGridWithNodes(GridContainer grid, Map<NodeInput, NodeInput> oldToNewNodes) Updates the providedGridContainerwith the provided mapping of old to newNodeInputentities. When used, one carefully has to check that the mapping is valid. No further sanity checks are provided and if an invalid mapping is passed in, unexpected behavior might occur. All entities holding reference to the old nodes are updates with this method.If the geoPosition of one transformer node is altered, all other transformer nodes geoPositions are updated as well based on the update definition defined in
updateTransformers(Set, Set, Map)as by convention transformer nodes always needs to have the same geoPosition. If a chain of transformers is present e.g. nodeA - trafoAtoD - nodeD - trafoDtoG - nodeG all affected transformer nodes geoPosition is set to the same location as defined by the update rule defined inupdateTransformers(Set, Set, Map)- Parameters:
grid- the grid that should be updatedoldToNewNodes- a mapping of old nodes to their corresponding new or updated nodes- Returns:
- a copy of the provided grid with updated nodes as provided
-
updateGridWithNodes
public static JointGridContainer updateGridWithNodes(JointGridContainer grid, Map<NodeInput, NodeInput> oldToNewNodes) Updates the providedJointGridContainerwith the provided mapping of old to newNodeInputentities. When used, one carefully has to check that the mapping is valid. No further sanity checks are provided and if an invalid mapping is passed in, unexpected behavior might occur. All entities holding reference to the old nodes are updates with this method.If the geoPosition of one transformer node is altered, all other transformer nodes geoPositions are updated as well based on the update definition defined in
updateTransformers(Set, Set, Map)as by convention transformer nodes always needs to have the same geoPosition. If a chain of transformers is present e.g. nodeA - trafoAtoD - nodeD - trafoDtoG - nodeG all affected transformer nodes geoPosition is set to the same location as defined by the update rule defined inupdateTransformers(Set, Set, Map)- Parameters:
grid- the grid that should be updatedoldToNewNodes- a mapping of old nodes to their corresponding new or updated nodes- Returns:
- a copy of the provided grid with updated nodes as provided
-
updateGridWithNodes
public static SubGridContainer updateGridWithNodes(SubGridContainer grid, Map<NodeInput, NodeInput> oldToNewNodes) Updates the providedSubGridContainerwith the provided mapping of old to newNodeInputentities. When used, one carefully has to check that the mapping is valid. No further sanity checks are provided and if an invalid mapping is passed in, unexpected behavior might occur. Furthermore, if the subgrid to be updated is part of aJointGridContainerit is highly advised NOT to update a single subgrid, but the whole joint grid, because in case of transformer node updates on a single subgrid, inconsistency of the overall joint grid might occur. To update the whole joint grid useupdateGridWithNodes(JointGridContainer, Map)If the geoPosition of one transformer node is altered, all other transformer nodes geoPositions are updated as well based on the update definition defined in
updateTransformers(Set, Set, Map)as by convention transformer nodes always needs to have the same geoPosition. If a chain of transformers is present e.g. nodeA - trafoAtoD - nodeD - trafoDtoG - nodeG all affected transformer nodes geoPosition is set to the same location as defined by the update rule defined inupdateTransformers(Set, Set, Map)- Parameters:
grid- the grid that should be updatedoldToNewNodes- a mapping of old nodes to their corresponding new or updated nodes- Returns:
- a copy of the provided grid with updated nodes as provided
-