Class NodeUnassigner
java.lang.Object
com.dna.jopt.member.unit.unassign.NodeUnassigner
- All Implemented Interfaces:
INodeUnassigner,Serializable
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUnassignedNodes(List<? extends IOptimizationElement> unassignedNodes) Removes from the input allNodesthat were alreadyunassignedso there are no duplicates, then adds the remainingNodesto the list.voidClears thelistofunassign Nodes.copy()extractConnectedNodes(INode currentNode, Set<INode> alreadyExtractedNodes, boolean respectOnlyStrongCoupling) extractConnectedNodes(List<IOptimizationElement> els, boolean respectOnlyStrongCoupling) Gets the firstNodeinunassigned Nodecorresponding with that Id.Gets a newArrayListwith all theunassigned Nodes.Gets all theunassigned Nodeswith that ID.intGets the number ofunassigned Nodes.booleanReturnstrueif there are alreadyunassigned Nodes.static voidremoveFromEntities(List<IEntity> entities, List<IOptimizationElement> unassignedNodes) booleanremoveUnassignedNode(IOptimizationElement unassignedNode) Removes the givenNodesfromlistofunassigned Nodes.booleanremoveUnassignedNodes(List<? extends IOptimizationElement> unassignedNodes) Removes the input from theListofunassigned Nodes, then returns the remainingunassigned Nodes.unassignNodes(List<IEntity> entities, List<IOptimizationElement> unassignedNodesOrg) Unassigns the givenNodes.
-
Field Details
-
RELATION_FILTER_REASON
- See Also:
-
NON_INJECTABLE_REASON
- See Also:
-
-
Constructor Details
-
NodeUnassigner
-
NodeUnassigner
public NodeUnassigner()
-
-
Method Details
-
copy
- Specified by:
copyin interfaceINodeUnassigner
-
extractConnectedNodes
public static List<INode> extractConnectedNodes(List<IOptimizationElement> els, boolean respectOnlyStrongCoupling) -
unassignNodes
public List<INodeFilterReason> unassignNodes(List<IEntity> entities, List<IOptimizationElement> unassignedNodesOrg) Description copied from interface:INodeUnassignerUnassigns the givenNodes. IfNodeswererelatedto theNodesto be unassigned, itsresource constraintsget detached andINode#setUnassigned(boolean)is set totrue.- Specified by:
unassignNodesin interfaceINodeUnassigner- Parameters:
entities- the list of iEntities of theNodesunassignedNodesOrg- the list of iOptimizationElements to be unassigned- Returns:
- the list
-
removeFromEntities
public static void removeFromEntities(List<IEntity> entities, List<IOptimizationElement> unassignedNodes) -
extractConnectedNodes
-
addUnassignedNodes
Description copied from interface:INodeUnassignerRemoves from the input allNodesthat were alreadyunassignedso there are no duplicates, then adds the remainingNodesto the list.- Specified by:
addUnassignedNodesin interfaceINodeUnassigner- Parameters:
unassignedNodes- the iOptimizationElement Nodes to be added to the list
-
removeUnassignedNodes
Description copied from interface:INodeUnassignerRemoves the input from theListofunassigned Nodes, then returns the remainingunassigned Nodes.- Specified by:
removeUnassignedNodesin interfaceINodeUnassigner- Parameters:
unassignedNodes- the iOptimizationElement to be removed- Returns:
- the remaining unassigned nodes
-
getUnassignedNodesById
Description copied from interface:INodeUnassignerGets all theunassigned Nodeswith that ID.- Specified by:
getUnassignedNodesByIdin interfaceINodeUnassigner- Parameters:
id- the string id of theNodes- Returns:
- the
Nodeswith that ID
-
getUnassignedFirstNodeById
Description copied from interface:INodeUnassignerGets the firstNodeinunassigned Nodecorresponding with that Id.- Specified by:
getUnassignedFirstNodeByIdin interfaceINodeUnassigner- Parameters:
id- the string Id of theNode- Returns:
- the first
Nodefound with that ID
-
getUnassignedNodesCount
public int getUnassignedNodesCount()Description copied from interface:INodeUnassignerGets the number ofunassigned Nodes.- Specified by:
getUnassignedNodesCountin interfaceINodeUnassigner- Returns:
- the number of
unassigned Nodes
-
getUnassignedNodes
Description copied from interface:INodeUnassignerGets a newArrayListwith all theunassigned Nodes.- Specified by:
getUnassignedNodesin interfaceINodeUnassigner- Returns:
- the list of unassignedNodes
-
cleanUnassignedNodeList
public void cleanUnassignedNodeList()Description copied from interface:INodeUnassignerClears thelistofunassign Nodes.- Specified by:
cleanUnassignedNodeListin interfaceINodeUnassigner
-
removeUnassignedNode
Description copied from interface:INodeUnassignerRemoves the givenNodesfromlistofunassigned Nodes.- Specified by:
removeUnassignedNodein interfaceINodeUnassigner- Parameters:
unassignedNode- the iOptimizationElement nodes to be unassigned- Returns:
- the list of remaining iOptimizationElement
-
hasUnassignedNodes
public boolean hasUnassignedNodes()Description copied from interface:INodeUnassignerReturnstrueif there are alreadyunassigned Nodes.- Specified by:
hasUnassignedNodesin interfaceINodeUnassigner- Returns:
falsenoNodeshave been unassigned yet
-