com.prosysopc.ua
Class NodeMap

java.lang.Object
  extended by com.prosysopc.ua.NodeMap
Direct Known Subclasses:
NodeCache, NodeMapUaNode

public abstract class NodeMap
extends Object

A node container. The container is used to hold a UA node objects. It can also be used to create new node objects, using addNode(com.prosysopc.ua.nodes.UaNode) and addType(org.opcfoundation.ua.core.NodeClass, org.opcfoundation.ua.builtintypes.NodeId, java.lang.String, java.lang.Class).


Field Summary
protected  Locale defaultLocale
           
protected  UaNodeFactory nodeFactory
           
 
Constructor Summary
NodeMap(UaNodeFactory nodeFactory)
           
 
Method Summary
abstract  UaNode addNode(UaNode node)
           
<T extends UaType>
T
addType(org.opcfoundation.ua.core.NodeClass nodeClass, org.opcfoundation.ua.builtintypes.NodeId type, String name, Class<?> javaClass)
          Create a type node and add it to the map.
<T extends UaType>
T
addType(T parentType, org.opcfoundation.ua.builtintypes.NodeId type, String name, Class<?> javaClass)
           
abstract  void clear()
          Clear the node map of all entries.
abstract  UaNode getNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
           
 UaNodeFactory getNodeFactory()
          The node factory can be used to define which object classes are used for different node types.
abstract  boolean hasNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
          Check if the map contains a node with the specified NodeId.
abstract  UaNode remove(org.opcfoundation.ua.builtintypes.NodeId nodeId)
          Remove a node from the node map.
 UaNode remove(UaNode node)
          Remove a node from the node map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultLocale

protected final Locale defaultLocale

nodeFactory

protected UaNodeFactory nodeFactory
Constructor Detail

NodeMap

public NodeMap(UaNodeFactory nodeFactory)
Method Detail

addNode

public abstract UaNode addNode(UaNode node)

addType

public <T extends UaType> T addType(org.opcfoundation.ua.core.NodeClass nodeClass,
                                    org.opcfoundation.ua.builtintypes.NodeId type,
                                    String name,
                                    Class<?> javaClass)
                         throws UaNodeFactoryException
Create a type node and add it to the map. The actual type of the object that is created depends on the arguments and the classes that are registered to the nodeFactory of the map.

Parameters:
nodeClass - the node class of the type
type - the NodeId of the type
name - the browse and display name of the type (display name uses defaultLocale of the map)
javaClass - the Java class that is used to represent the type, if necessary. This is use by the DataTypeConverter, for example.
Returns:
the new type node
Throws:
UaNodeFactoryException - if the node cannot be created.

addType

public <T extends UaType> T addType(T parentType,
                                    org.opcfoundation.ua.builtintypes.NodeId type,
                                    String name,
                                    Class<?> javaClass)
                         throws UaNodeFactoryException
Parameters:
parentType - the parent data type. Must not be null.
name -
type -
javaClass -
Throws:
UaNodeFactoryException

clear

public abstract void clear()
Clear the node map of all entries.


getNode

public abstract UaNode getNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)

getNodeFactory

public UaNodeFactory getNodeFactory()
The node factory can be used to define which object classes are used for different node types.

Returns:
the nodeFactory used by the map.

hasNode

public abstract boolean hasNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
Check if the map contains a node with the specified NodeId.

Parameters:
nodeId - the ID to check
Returns:
true, if the map contains a node with ID

remove

public abstract UaNode remove(org.opcfoundation.ua.builtintypes.NodeId nodeId)
Remove a node from the node map.

Parameters:
nodeId - the node to remove.
Returns:
the node that was removed or null, if it was not in the map.

remove

public UaNode remove(UaNode node)
Remove a node from the node map.

Parameters:
node - the node to remove.
Returns:
the node that was removed or null, if it was not in the map.


Copyright © 2018. All rights reserved.