public class AbstractNodeManager<T extends Node> extends Object implements NodeManager<T>
| Constructor and Description |
|---|
AbstractNodeManager() |
| Modifier and Type | Method and Description |
|---|---|
Optional<T> |
addNode(T node)
|
void |
addReference(Reference reference)
Add
reference to this NodeManager. |
void |
addReferences(Reference reference,
NamespaceTable namespaceTable)
Add
reference and its inverse to this NodeManager. |
boolean |
containsNode(ExpandedNodeId nodeId,
NamespaceTable namespaceTable)
|
boolean |
containsNode(NodeId nodeId)
|
Optional<T> |
getNode(ExpandedNodeId nodeId,
NamespaceTable namespaceTable)
|
Optional<T> |
getNode(NodeId nodeId)
Get the Node identified by
nodeId from this NodeManager, if it exists. |
List<NodeId> |
getNodeIds()
Get a copied List of the
NodeIds being managed. |
protected ConcurrentMap<NodeId,T> |
getNodeMap()
Get the backing
ConcurrentMap holding this NodeManager's Nodes. |
List<T> |
getNodes()
Get a copied List of the Nodes being managed.
|
ConcurrentMap<NodeId,com.google.common.collect.LinkedHashMultiset<Reference>> |
getReferenceMap()
Get the backing
ConcurrentMap holding this NodeManager's References. |
List<Reference> |
getReferences(NodeId nodeId)
|
List<Reference> |
getReferences(NodeId nodeId,
Predicate<Reference> filter)
|
protected ConcurrentMap<NodeId,T> |
makeNodeMap(com.google.common.collect.MapMaker mapMaker)
Optionally customize the backing
ConcurrentMap with the provided MapMaker. |
Optional<T> |
removeNode(ExpandedNodeId nodeId,
NamespaceTable namespaceTable)
|
Optional<T> |
removeNode(NodeId nodeId)
Remove the Node identified by
nodeId from this NodeManager, if it exists. |
void |
removeReference(Reference reference)
Remove
reference from this NodeManager. |
void |
removeReferences(Reference reference,
NamespaceTable namespaceTable)
Remove
reference and its inverse from this NodeManager. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontainsNode, get, get, removeNodeprotected ConcurrentMap<NodeId,T> makeNodeMap(com.google.common.collect.MapMaker mapMaker)
ConcurrentMap with the provided MapMaker.mapMaker - the MapMaker that make the backing map with.ConcurrentMap.protected ConcurrentMap<NodeId,T> getNodeMap()
ConcurrentMap holding this NodeManager's Nodes.ConcurrentMap holding this NodeManager's Nodes.public ConcurrentMap<NodeId,com.google.common.collect.LinkedHashMultiset<Reference>> getReferenceMap()
ConcurrentMap holding this NodeManager's References.ConcurrentMap holding this NodeManager's References.public List<T> getNodes()
public List<NodeId> getNodeIds()
NodeIds being managed.NodeIds being managed.public boolean containsNode(NodeId nodeId)
NodeManagercontainsNode in interface NodeManager<T extends Node>nodeId - the NodeId.true if this NodeManager contains the Node identified by nodeId.public boolean containsNode(ExpandedNodeId nodeId, NamespaceTable namespaceTable)
NodeManagercontainsNode in interface NodeManager<T extends Node>nodeId - the ExpandedNodeId to check.namespaceTable - the NamespaceTable.true if this NodeManager contains nodeId.public Optional<T> addNode(T node)
NodeManagerpublic Optional<T> getNode(NodeId nodeId)
NodeManagernodeId from this NodeManager, if it exists.getNode in interface NodeManager<T extends Node>nodeId - the NodeId identifying the Node to get.nodeId from this NodeManager, if it exists.public Optional<T> getNode(ExpandedNodeId nodeId, NamespaceTable namespaceTable)
NodeManagerNode identified by nodeId from this NodeManager, or null if it does not
exist.
Returns false if nodeId is non-local.
getNode in interface NodeManager<T extends Node>nodeId - the ExpandedNodeId identifying the Node to get.namespaceTable - the NamespaceTable.Node identified by nodeId from this NodeManager or null if it does
not exist.public Optional<T> removeNode(NodeId nodeId)
NodeManagernodeId from this NodeManager, if it exists.removeNode in interface NodeManager<T extends Node>nodeId - the NodeId identifying the Node to remove.NodeManager, if it exists.public Optional<T> removeNode(ExpandedNodeId nodeId, NamespaceTable namespaceTable)
NodeManagerNode identified by nodeId from this NodeManager, if it exists.
Returns Optional.empty() if nodeId is non-local.
removeNode in interface NodeManager<T extends Node>nodeId - the ExpandedNodeId identifying the Node to get.namespaceTable - the NamespaceTable.Node identified by nodeId from this NodeManager, if it exists.public void addReference(Reference reference)
NodeManagerreference to this NodeManager.addReference in interface NodeManager<T extends Node>reference - the Reference to add.public void addReferences(Reference reference, NamespaceTable namespaceTable)
NodeManagerreference and its inverse to this NodeManager.addReferences in interface NodeManager<T extends Node>reference - the Reference to add.namespaceTable - the NamespaceTable.public void removeReference(Reference reference)
NodeManagerreference from this NodeManager.removeReference in interface NodeManager<T extends Node>reference - the Reference to remove.public void removeReferences(Reference reference, NamespaceTable namespaceTable)
NodeManagerreference and its inverse from this NodeManager.removeReferences in interface NodeManager<T extends Node>reference - the Reference to remove.namespaceTable - the NamespaceTable.public List<Reference> getReferences(NodeId nodeId)
NodeManagergetReferences in interface NodeManager<T extends Node>nodeId - the source NodeId.References that have nodeId as their source NodeId.public List<Reference> getReferences(NodeId nodeId, Predicate<Reference> filter)
NodeManagergetReferences in interface NodeManager<T extends Node>nodeId - the source NodeId.filter - a Predicate to filter References.References that have nodeId as their source NodeId, filtered by
filter.Copyright © 2021. All rights reserved.