org.openmuc.openiec61850

## Class ModelNode

- java.lang.Object
- - org.openmuc.openiec61850.ModelNode

All Implemented Interfaces:
  java.lang.Iterable<ModelNode>

Direct Known Subclasses:
  FcModelNode, LogicalDevice, LogicalNode, ServerModel

    public abstract class ModelNode
    extends java.lang.Object
    implements java.lang.Iterable<ModelNode>

### Field Summary

Fields
`protected java.util.Map<java.lang.String,ModelNode>` `children`
`protected ObjectReference` `objectReference`

### Constructor Summary

Constructors
Constructor and Description
`ModelNode()`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`abstract ModelNode` `copy()` Returns a copy of model node with all of its children.
`java.util.List<BasicDataAttribute>` `getBasicDataAttributes()` Returns a list of all leaf nodes (basic data attributes) contained in the subtree of this model node.
`ModelNode` `getChild(java.lang.String name)` Returns the child node with the given name.
`ModelNode` `getChild(java.lang.String name, Fc fc)` Returns the child node with the given name and functional constraint.
`java.util.Collection<ModelNode>` `getChildren()`
`protected java.util.Iterator<java.util.Iterator<? extends ModelNode>>` `getIterators()`
`java.lang.String` `getName()` Returns the name of the model node.
`ModelNode` `getParent()` Returns the parent node of this node.
`ObjectReference` `getReference()` Returns the reference of the model node.
`java.util.Iterator<ModelNode>` `iterator()`
`java.lang.String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

### Field Detail

#### objectReference

    protected ObjectReference objectReference

#### children

    protected java.util.Map<java.lang.String,ModelNode> children

### Constructor Detail

#### ModelNode

    public ModelNode()

### Method Detail

#### copy

    public abstract ModelNode copy()

Returns a copy of model node with all of its children. Creates new BasicDataAttribute values but reuses ObjectReferences, FunctionalConstraints.

Returns:
  a copy of model node with all of its children.

#### getChild

    public ModelNode getChild(java.lang.String name)

Returns the child node with the given name. Will always return null if called on a logical node because a logical node need the functional constraint to uniquely identify a child. For logical nodes use `getChild(String name, Fc fc)` instead.

Parameters:
  `name` - the name of the requested child node
Returns:
  the child node with the given name.

#### getChild

    public ModelNode getChild(java.lang.String name,
                              Fc fc)

Returns the child node with the given name and functional constraint. The fc is ignored if this function is called on any model node other than logical node.

Parameters:
  `name` - the name of the requested child node
  `fc` - the functional constraint of the requested child node
Returns:
  the child node with the given name and functional constrain

#### getChildren

    public java.util.Collection<ModelNode> getChildren()

#### getIterators

    protected java.util.Iterator<java.util.Iterator<? extends ModelNode>> getIterators()

#### getReference

    public ObjectReference getReference()

Returns the reference of the model node.

Returns:
  the reference of the model node.

#### getName

    public java.lang.String getName()

Returns the name of the model node.

Returns:
  the name of the model node.

#### iterator

    public java.util.Iterator<ModelNode> iterator()

Specified by:
  `iterator` in interface `java.lang.Iterable<ModelNode>`

#### getBasicDataAttributes

    public java.util.List<BasicDataAttribute> getBasicDataAttributes()

Returns a list of all leaf nodes (basic data attributes) contained in the subtree of this model node.

Returns:
  a list of all leaf nodes (basic data attributes) contained in the subtree of this model node.

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`

#### getParent

    public ModelNode getParent()

Returns the parent node of this node.

Returns:
  the parent node of this node.