Class NodeUnassigner
java.lang.Object
com.dna.jopt.member.unit.unassign.NodeUnassigner
- All Implemented Interfaces:
INodeUnassigner
,Serializable
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addUnassignedNodes
(List<? extends IOptimizationElement> unassignedNodes) Removes from the input allNodes
that were alreadyunassigned
so there are no duplicates, then adds the remainingNodes
to the list.void
Clears thelist
ofunassign Nodes
.copy()
extractConnectedNodes
(INode currentNode, Set<INode> alreadyExtractedNodes, boolean respectOnlyStrongCoupling) extractConnectedNodes
(List<IOptimizationElement> els, boolean respectOnlyStrongCoupling) Gets the firstNode
inunassigned Node
corresponding with that Id.Gets a newArrayList
with all theunassigned Nodes
.Gets all theunassigned Nodes
with that ID.int
Gets the number ofunassigned Nodes
.boolean
Returnstrue
if there are alreadyunassigned Nodes
.static void
removeFromEntities
(List<IEntity> entities, List<IOptimizationElement> unassignedNodes) boolean
removeUnassignedNode
(IOptimizationElement unassignedNode) Removes the givenNodes
fromlist
ofunassigned Nodes
.boolean
removeUnassignedNodes
(List<? extends IOptimizationElement> unassignedNodes) Removes the input from theList
ofunassigned 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:
copy
in 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:INodeUnassigner
Unassigns the givenNodes
. IfNodes
wererelated
to theNodes
to be unassigned, itsresource constraints
get detached andINode#setUnassigned(boolean)
is set totrue
.- Specified by:
unassignNodes
in interfaceINodeUnassigner
- Parameters:
entities
- the list of iEntities of theNodes
unassignedNodesOrg
- 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:INodeUnassigner
Removes from the input allNodes
that were alreadyunassigned
so there are no duplicates, then adds the remainingNodes
to the list.- Specified by:
addUnassignedNodes
in interfaceINodeUnassigner
- Parameters:
unassignedNodes
- the iOptimizationElement Nodes to be added to the list
-
removeUnassignedNodes
Description copied from interface:INodeUnassigner
Removes the input from theList
ofunassigned Nodes
, then returns the remainingunassigned Nodes
.- Specified by:
removeUnassignedNodes
in interfaceINodeUnassigner
- Parameters:
unassignedNodes
- the iOptimizationElement to be removed- Returns:
- the remaining unassigned nodes
-
getUnassignedNodesById
Description copied from interface:INodeUnassigner
Gets all theunassigned Nodes
with that ID.- Specified by:
getUnassignedNodesById
in interfaceINodeUnassigner
- Parameters:
id
- the string id of theNodes
- Returns:
- the
Nodes
with that ID
-
getUnassignedFirstNodeById
Description copied from interface:INodeUnassigner
Gets the firstNode
inunassigned Node
corresponding with that Id.- Specified by:
getUnassignedFirstNodeById
in interfaceINodeUnassigner
- Parameters:
id
- the string Id of theNode
- Returns:
- the first
Node
found with that ID
-
getUnassignedNodesCount
public int getUnassignedNodesCount()Description copied from interface:INodeUnassigner
Gets the number ofunassigned Nodes
.- Specified by:
getUnassignedNodesCount
in interfaceINodeUnassigner
- Returns:
- the number of
unassigned Nodes
-
getUnassignedNodes
Description copied from interface:INodeUnassigner
Gets a newArrayList
with all theunassigned Nodes
.- Specified by:
getUnassignedNodes
in interfaceINodeUnassigner
- Returns:
- the list of unassignedNodes
-
cleanUnassignedNodeList
public void cleanUnassignedNodeList()Description copied from interface:INodeUnassigner
Clears thelist
ofunassign Nodes
.- Specified by:
cleanUnassignedNodeList
in interfaceINodeUnassigner
-
removeUnassignedNode
Description copied from interface:INodeUnassigner
Removes the givenNodes
fromlist
ofunassigned Nodes
.- Specified by:
removeUnassignedNode
in interfaceINodeUnassigner
- Parameters:
unassignedNode
- the iOptimizationElement nodes to be unassigned- Returns:
- the list of remaining iOptimizationElement
-
hasUnassignedNodes
public boolean hasUnassignedNodes()Description copied from interface:INodeUnassigner
Returnstrue
if there are alreadyunassigned Nodes
.- Specified by:
hasUnassignedNodes
in interfaceINodeUnassigner
- Returns:
false
noNodes
have been unassigned yet
-