com.ihr.xbrl.om.table.structural

## Class XBRLStructuralNode

- java.lang.Object
- - com.ihr.xbrl.om.table.structural.XBRLStructuralNode

- All Implemented Interfaces:
    StructuralNodeInterface
  Direct Known Subclasses:
    XBRLClosedRelationshipStructuralNode, XBRLClosedStructuralNode, XBRLOpenStructuralNode

      public abstract class XBRLStructuralNode
      extends java.lang.Object
      implements StructuralNodeInterface

  This is the implementation class for the StructuralNodeInterface interface. Every element in a table header is represented with an instance of this class
  Author:
    Ignacio

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XBRLStructuralNode(XBRLDefinitionNodeUse base, XBRLStructuralNode parent, java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.Object,AspectAndDistanceToLeaf>> mergeAspects, java.lang.String mergeTagSelectors)` Creates an instance of a TableStructuralNode and collects all aspects indicated in the definition node indicated in the base parameter.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `addChild(XBRLStructuralNode child)` Append a new children to this tree node.
    `void` | `addMergeAspect(Aspect<?> as)` Adds the merge aspect.
    `java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.Object,AspectAndDistanceToLeaf>>` | `collectAspects()` Collect aspects on this node and returns a structure with aspects indexed by tag.
    `static XBRLStructuralNode[]` | `create(XBRLDefinitionNodeUse dnu, XBRLStructuralNode parent, java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.Object,AspectAndDistanceToLeaf>> mergeAspects, java.lang.String mergeTagSelectors, XBRLStructuralTable xbrlTable, HasParentChildAttribute.ParentChildEnum parentChildValue)` Factory method to create either an open structural node or a closed structural node depending on the definition node.
    `static XBRLStructuralNode` | `create(XBRLDefinitionNodeUse dnu, XBRLStructuralNode parent, java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.Object,AspectAndDistanceToLeaf>> mergeAspects, java.lang.String mergeTagSelectors, XBRLStructuralTable xbrlTable, RelationshipGraphNode.Node<?> node)` Creates the.
    `static XBRLStructuralNode` | `createRollup(XBRLStructuralNode parent, java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.Object,AspectAndDistanceToLeaf>> mergeAspects, java.lang.String mergeTagSelectors)` Factory method to create a roll-up structural node.
    `java.util.Iterator<AspectAndDistanceToLeaf>` | `getAspects(java.lang.String tag)` Allows to iterate all aspects on this node.
    `XBRLDefinitionNodeUse` | `getBase()` Access to the XBRLDefinitionNodeUse element that is the source of this TableStructuralNode.
    `java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.Object,AspectAndDistanceToLeaf>>` | `getConsolidatedAspects()` Gets the consolidated aspects.
    `int` | `getDistanceToLeaf()` Gets the distance to leaf.
    `abstract java.lang.String` | `getLabel(CellHeader cell)` Returns a label that represents the structural node.
    `java.util.Iterator<AspectAndDistanceToLeaf>` | `getLocalAspects(java.lang.String tag)` Allows to iterate all aspects on this node.
    `java.util.Iterator<java.lang.String>` | `getLocalTags()` Gets the local tags.
    `java.lang.String` | `getMergeTagSelector()` Gets the merge tag selector.
    `XBRLStructuralNode` | `getNodeAt(int index)` Access a specific TableStructuralNode by index.
    `int` | `getNodeCount()` Number of children nodes.
    `java.util.Iterator<XBRLStructuralNode>` | `getNodes()` Allows to iterate all nodes in the right representation order.
    `XBRLStructuralNode` | `getParent()` Access to the parent node of this StructuralNodeInterface.
    `java.util.Iterator<java.lang.String>` | `getTags()` Gets the tags.
    `java.util.HashSet<java.lang.String>` | `getTagSelector()` if a tag selector exists in the surrounding definition node.
    `abstract int` | `getValueCount()` Returns the number of nodes for this structural node at this level (does not count children nodes) For closed nodes, the returned value is most likely 1.
    `boolean` | `hasAspect(Aspect<?> aspect)` if this structural node contains the aspect passed in as a parameter, then the cell header in header is returned.
    `abstract boolean` | `isAbstract()` Returns true if this is a rule node and it is marked as abstract.
    `boolean` | `isLeaf()` last node in a tree is leaf node.
    `boolean` | `isRollUp()` Returns true if this structural node is a roll-up node.
    `void` | `resetDistanceToLeaf()` Reset distance to lead for all aspects.
    `void` | `resetMergeTagSelector()` Reset merge tag selector.
    `java.lang.String` | `toString()`

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

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

- - ### Constructor Detail

    - #### XBRLStructuralNode

          public XBRLStructuralNode(XBRLDefinitionNodeUse base,
                            XBRLStructuralNode parent,
                            java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.Object,AspectAndDistanceToLeaf>> mergeAspects,
                            java.lang.String mergeTagSelectors)

      Creates an instance of a TableStructuralNode and collects all aspects indicated in the definition node indicated in the base parameter.
      Parameters:
        `base` - the XBRLDefinitionNodeUse that is the source of this TableStructuralNode
        `parent` - the parent TableStructuralNode to allow navigation up on the tree. This is null for root nodes
        `mergeAspects` - the merge aspects
        `mergeTagSelectors` - the merge tag selectors

  - ### Method Detail

    - #### getConsolidatedAspects

          public java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.Object,AspectAndDistanceToLeaf>> getConsolidatedAspects()

      Gets the consolidated aspects.
      Returns:
        the consolidated aspects

    - #### collectAspects

          public java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.Object,AspectAndDistanceToLeaf>> collectAspects()

      Collect aspects on this node and returns a structure with aspects indexed by tag.
      Returns:
        the hashtable

    - #### getTags

          public java.util.Iterator<java.lang.String> getTags()

      Gets the tags.
      Returns:
        the tags

    - #### getLocalTags

          public java.util.Iterator<java.lang.String> getLocalTags()

      Gets the local tags.
      Returns:
        the local tags

    - #### getAspects

          public java.util.Iterator<AspectAndDistanceToLeaf> getAspects(java.lang.String tag)

      Allows to iterate all aspects on this node. If no aspects are defined this returns an empty iterator
      Parameters:
        `tag` - the tag
      Returns:
        Iterator on all aspects

    - #### getLocalAspects

          public java.util.Iterator<AspectAndDistanceToLeaf> getLocalAspects(java.lang.String tag)

      Allows to iterate all aspects on this node. If no aspects are defined this returns an empty iterator
      Parameters:
        `tag` - the tag
      Returns:
        Iterator on all aspects

    - #### getParent

          public XBRLStructuralNode getParent()

      Description copied from interface: `StructuralNodeInterface`
      Access to the parent node of this StructuralNodeInterface. If this node is the root the parent is null
      Specified by:
        `getParent` in interface `StructuralNodeInterface`
      Returns:
        TableStructuralNode parent node or null

    - #### getBase

          public XBRLDefinitionNodeUse getBase()

      Access to the XBRLDefinitionNodeUse element that is the source of this TableStructuralNode. It is null if the node is not generated from a definition node, for example is roll up nodes.
      Returns:
        XBRLDefinitionNodeUse base XBRL Resource

    - #### addChild

          public boolean addChild(XBRLStructuralNode child)

      Append a new children to this tree node.
      Parameters:
        `child` - node to add at the end of the collection
      Returns:
        boolean if the node was added

    - #### isLeaf

          public boolean isLeaf()

      Description copied from interface: `StructuralNodeInterface`
      last node in a tree is leaf node.
      Specified by:
        `isLeaf` in interface `StructuralNodeInterface`
      Returns:
        true if this is the leaf node

    - #### isRollUp

          public boolean isRollUp()

      Returns true if this structural node is a roll-up node.
      Returns:
        boolean value

    - #### getLabel

          public abstract java.lang.String getLabel(CellHeader cell)

      Returns a label that represents the structural node. This label will be used in the user interface so the label shall consider user preferences set in the DTSContainer. The cell parameter can provide required information to know the cell position or value index on open nodes
      Parameters:
        `cell` - the cell
      Returns:
        the label

    - #### isAbstract

          public abstract boolean isAbstract()

      Returns true if this is a rule node and it is marked as abstract.
      Returns:
        boolean value

    - #### getNodes

          public java.util.Iterator<XBRLStructuralNode> getNodes()

      Description copied from interface: `StructuralNodeInterface`
      Allows to iterate all nodes in the right representation order.
      Specified by:
        `getNodes` in interface `StructuralNodeInterface`
      Returns:
        an iterator over all TableStructuralNode at this level

    - #### getNodeAt

          public XBRLStructuralNode getNodeAt(int index)

      Description copied from interface: `StructuralNodeInterface`
      Access a specific TableStructuralNode by index.
      Specified by:
        `getNodeAt` in interface `StructuralNodeInterface`
      Parameters:
        `index` - integer
      Returns:
        TableStructuralNode

    - #### getNodeCount

          public int getNodeCount()

      Description copied from interface: `StructuralNodeInterface`
      Number of children nodes.
      Specified by:
        `getNodeCount` in interface `StructuralNodeInterface`
      Returns:
        integer

    - #### create

          public static XBRLStructuralNode[] create(XBRLDefinitionNodeUse dnu,
                                    XBRLStructuralNode parent,
                                    java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.Object,AspectAndDistanceToLeaf>> mergeAspects,
                                    java.lang.String mergeTagSelectors,
                                    XBRLStructuralTable xbrlTable,
                                    HasParentChildAttribute.ParentChildEnum parentChildValue)
                                             throws XTValidationException

      Factory method to create either an open structural node or a closed structural node depending on the definition node.
      Parameters:
        `dnu` - definition node
        `parent` - is the parent of this structural node or null for root nodes
        `mergeAspects` - the merge aspects
        `mergeTagSelectors` - the merge tag selectors
        `xbrlTable` - the xbrl table
        `parentChildValue` - the parent child value
      Returns:
        the XBRL structural node[]
      Throws:
        `XTValidationException` - the XT validation exception

    - #### create

          public static XBRLStructuralNode create(XBRLDefinitionNodeUse dnu,
                                  XBRLStructuralNode parent,
                                  java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.Object,AspectAndDistanceToLeaf>> mergeAspects,
                                  java.lang.String mergeTagSelectors,
                                  XBRLStructuralTable xbrlTable,
                                  RelationshipGraphNode.Node<?> node)

      Creates the.
      Parameters:
        `dnu` - the dnu
        `parent` - the parent
        `mergeAspects` - the merge aspects
        `mergeTagSelectors` - the merge tag selectors
        `xbrlTable` - the xbrl table
        `node` - the node
      Returns:
        the XBRL structural node

    - #### createRollup

          public static XBRLStructuralNode createRollup(XBRLStructuralNode parent,
                                        java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.Object,AspectAndDistanceToLeaf>> mergeAspects,
                                        java.lang.String mergeTagSelectors)

      Factory method to create a roll-up structural node.
      Parameters:
        `parent` - the parent
        `mergeAspects` - the merge aspects
        `mergeTagSelectors` - the merge tag selectors
      Returns:
        the XBRL structural node

    - #### getValueCount

          public abstract int getValueCount()

      Returns the number of nodes for this structural node at this level (does not count children nodes) For closed nodes, the returned value is most likely 1. There might be exceptions if the concept is abstract. In that case, the returned value might be 0 For open nodes, the returned value depends on the number of values that bind to the node definition and table filters
      Returns:
        the value count

    - #### toString

          public java.lang.String toString()

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

    - #### getTagSelector

          public java.util.HashSet<java.lang.String> getTagSelector()

      if a tag selector exists in the surrounding definition node. The value is added to the hashSet
      Returns:
        the tag selector

    - #### addMergeAspect

          public void addMergeAspect(Aspect<?> as)

      Adds the merge aspect.
      Parameters:
        `as` - the as

    - #### getDistanceToLeaf

          public int getDistanceToLeaf()

      Gets the distance to leaf.
      Returns:
        the distance to leaf

    - #### resetDistanceToLeaf

          public void resetDistanceToLeaf()

      Reset distance to lead for all aspects.

    - #### hasAspect

          public boolean hasAspect(Aspect<?> aspect)

      if this structural node contains the aspect passed in as a parameter, then the cell header in header is returned. Otherwise the same aspect is passed to the parent header for resolution. The method return null if the aspect is not in the cell hierarchy
      Parameters:
        `aspect` - the aspect
      Returns:
        header that contains the aspect

    - #### resetMergeTagSelector

          public void resetMergeTagSelector()

      Reset merge tag selector.

    - #### getMergeTagSelector

          public java.lang.String getMergeTagSelector()

      Gets the merge tag selector.
      Returns:
        the merge tag selector