public class NodeUnassigner extends Object implements INodeUnassigner
Modifier and Type | Field and Description |
---|---|
static String |
NON_INJECTABLE_REASON |
static String |
RELATION_FILTER_REASON |
Constructor and Description |
---|
NodeUnassigner() |
NodeUnassigner(IOptimization opti) |
Modifier and Type | Method and Description |
---|---|
void |
addUnassignedNodes(List<? extends IOptimizationElement> unassignedNodes)
Removes from the input all
Nodes that were already unassigned so there
are no duplicates, then adds the remaining Nodes to the list. |
void |
cleanUnassignedNodeList()
Clears the
list of unassign Nodes . |
INodeUnassigner |
copy() |
static Set<INode> |
extractConnectedNodes(INode currentNode,
Set<INode> alreadyExtractedNodes,
boolean respectOnlyStrongCoupling) |
static List<INode> |
extractConnectedNodes(List<IOptimizationElement> els,
boolean respectOnlyStrongCoupling) |
Optional<IOptimizationElement> |
getUnassignedFirstNodeById(String id)
Gets the first
Node in unassigned Node corresponding with that Id. |
List<IOptimizationElement> |
getUnassignedNodes()
Gets a new
ArrayList with all the unassigned Nodes . |
List<IOptimizationElement> |
getUnassignedNodesById(String id)
Gets all the
unassigned Nodes with that ID. |
int |
getUnassignedNodesCount()
Gets the number of
unassigned Nodes . |
boolean |
hasUnassignedNodes()
Returns
true if there are already unassigned Nodes . |
static void |
removeFromEntities(List<IEntity> entities,
List<IOptimizationElement> unassignedNodes) |
boolean |
removeUnassignedNode(IOptimizationElement unassignedNode)
Removes the given
Nodes from list of unassigned Nodes . |
boolean |
removeUnassignedNodes(List<? extends IOptimizationElement> unassignedNodes)
Removes the input from the
List of unassigned Nodes , then returns the remaining unassigned Nodes . |
List<INodeFilterReason> |
unassignNodes(List<IEntity> entities,
List<IOptimizationElement> unassignedNodesOrg)
Unassigns the given
Nodes . |
public static final String RELATION_FILTER_REASON
public static final String NON_INJECTABLE_REASON
public NodeUnassigner(IOptimization opti)
public NodeUnassigner()
public INodeUnassigner copy()
copy
in interface INodeUnassigner
public static List<INode> extractConnectedNodes(List<IOptimizationElement> els, boolean respectOnlyStrongCoupling)
public List<INodeFilterReason> unassignNodes(List<IEntity> entities, List<IOptimizationElement> unassignedNodesOrg)
INodeUnassigner
Nodes
. If Nodes
were
related
to the Nodes
to be unassigned, its resource constraints
get detached and
INode#setUnassigned(boolean)
is set to true
.unassignNodes
in interface INodeUnassigner
entities
- the list of iEntities of the Nodes
unassignedNodesOrg
- the list of iOptimizationElements to be unassignedpublic static void removeFromEntities(List<IEntity> entities, List<IOptimizationElement> unassignedNodes)
public static Set<INode> extractConnectedNodes(INode currentNode, Set<INode> alreadyExtractedNodes, boolean respectOnlyStrongCoupling)
public void addUnassignedNodes(List<? extends IOptimizationElement> unassignedNodes)
INodeUnassigner
Nodes
that were already unassigned
so there
are no duplicates, then adds the remaining Nodes
to the list.addUnassignedNodes
in interface INodeUnassigner
unassignedNodes
- the iOptimizationElement Nodes to be added to the listpublic boolean removeUnassignedNodes(List<? extends IOptimizationElement> unassignedNodes)
INodeUnassigner
List
of unassigned Nodes
, then returns the remaining unassigned Nodes
.removeUnassignedNodes
in interface INodeUnassigner
unassignedNodes
- the iOptimizationElement to be removedpublic List<IOptimizationElement> getUnassignedNodesById(String id)
INodeUnassigner
unassigned Nodes
with that ID.getUnassignedNodesById
in interface INodeUnassigner
id
- the string id of the Nodes
Nodes
with that IDpublic Optional<IOptimizationElement> getUnassignedFirstNodeById(String id)
INodeUnassigner
Node
in unassigned Node
corresponding with that Id.getUnassignedFirstNodeById
in interface INodeUnassigner
id
- the string Id of the Node
Node
found with that IDpublic int getUnassignedNodesCount()
INodeUnassigner
unassigned Nodes
.getUnassignedNodesCount
in interface INodeUnassigner
unassigned Nodes
public List<IOptimizationElement> getUnassignedNodes()
INodeUnassigner
ArrayList
with all the unassigned Nodes
.getUnassignedNodes
in interface INodeUnassigner
public void cleanUnassignedNodeList()
INodeUnassigner
list
of unassign Nodes
.cleanUnassignedNodeList
in interface INodeUnassigner
public boolean removeUnassignedNode(IOptimizationElement unassignedNode)
INodeUnassigner
Nodes
from list
of unassigned Nodes
.removeUnassignedNode
in interface INodeUnassigner
unassignedNode
- the iOptimizationElement nodes to be unassignedpublic boolean hasUnassignedNodes()
INodeUnassigner
true
if there are already unassigned Nodes
.hasUnassignedNodes
in interface INodeUnassigner
false
no Nodes
have been unassigned yetCopyright © 2017–2023 DNA Evolutions GmbH. All rights reserved.