com.ihr.xbrl.dts

## Class XBRLTreeNode

- java.lang.Object
- - com.ihr.xbrl.dts.XBRLTreeNode

- All Implemented Interfaces:
    javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode
  Direct Known Subclasses:
    XBRLTreeRoot

      public class XBRLTreeNode
      extends java.lang.Object
      implements javax.swing.tree.MutableTreeNode

  This class represents an object in a tree like in the presentation or calculation linkbases.
  Author:
    Ignacio

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XBRLTreeNode(XBRLTreeNode parent, XMLFragment node, XBRLTreeWalker walker, XBRLRoleType labelRole, java.lang.String weight)` Creates an XBRLTreeNode.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Enumeration<javax.swing.tree.MutableTreeNode>` | `children()`
    `boolean` | `equals(java.lang.Object other)`
    `boolean` | `getAllowsChildren()`
    `javax.swing.tree.TreeNode` | `getChildAt(int childIndex)`
    `int` | `getChildCount()`
    `XBRLTreeNode[]` | `getChildren()` Obtain the chilren elements of this element in the hierarchy of this TreeWalker If this node has no children an empty array is returned This function does not return null.
    `java.lang.String` | `getHash()` Gets the hash.
    `int` | `getIndex(javax.swing.tree.TreeNode node)`
    `java.util.Collection<java.lang.String>` | `getLabel(java.util.Iterator<java.lang.String> iterL)` Returns a Collection of labels of the node for the specified language If there are no labels in the specified language the function returns the first label found for the next language in the iterator of languages received as a parameter If there are no labels the function returns a string representation of the concept QName If there are multiple labels then the function returns a Collection of all of them Applications would have to choose which one to use.
    `XMLFragment` | `getNode()` Normally this can be casted to an XMLElementDefinition.
    `java.lang.String` | `getNodeName()` Gets the node name.
    `javax.swing.tree.MutableTreeNode` | `getParent()`
    `XBRLRoleType` | `getPreferredLabelRole()` Gets the preferred label role.
    `XBRLTreeWalker` | `getWalker()` Returns the tree walker building the tree this node belongs to.
    `java.lang.String` | `getWeight()` Gets the weight.
    `int` | `hashCode()`
    `void` | `insert(javax.swing.tree.MutableTreeNode child, int index)`
    `boolean` | `isLeaf()`
    `void` | `remove(int index)`
    `void` | `remove(javax.swing.tree.MutableTreeNode node)`
    `void` | `removeFromParent()`
    `void` | `setLabelsRoles(XBRLRoleType[] roles)` Sets the roles (and the order of the roles) of extended links in which labels will be retrieved from the labels linkbase.
    `void` | `setNumber(int nodeSeq)` Sets the number.
    `void` | `setParent(javax.swing.tree.MutableTreeNode newParent)`
    `void` | `setUserObject(java.lang.Object object)`

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

      `getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### XBRLTreeNode

          public XBRLTreeNode(XBRLTreeNode parent,
                      XMLFragment node,
                      XBRLTreeWalker walker,
                      XBRLRoleType labelRole,
                      java.lang.String weight)

      Creates an XBRLTreeNode. Normally the DTSExplorer creates the nodes for you A node can be created in order to access to its labels using this class as a helper
      Parameters:
        `parent` - XBRLTreeNode, null for the root node
        `node` - The XMLFragment that this XBRLTreeNode represents. Cannot be null.
        `walker` - the parent XBRLTreeWalker this node belongs to. Can be null.
        `labelRole` - the role for retrieving labels. Should not be null if a label is going to be retrieved later. If null then the standard label-role is used.
        `weight` - the value of the weight attribute on calculationArc arcs. Can be null.

  - ### Method Detail

    - #### setLabelsRoles

          public void setLabelsRoles(XBRLRoleType[] roles)

      Sets the roles (and the order of the roles) of extended links in which labels will be retrieved from the labels linkbase.
      Parameters:
        `roles` - the new labels roles

    - #### hashCode

          public int hashCode()

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

    - #### equals

          public boolean equals(java.lang.Object other)

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

    - #### getNode

          public XMLFragment getNode()

      Normally this can be casted to an XMLElementDefinition.
      Returns:
        XMLFragment the surrounding element for this node

    - #### getLabel

          public java.util.Collection<java.lang.String> getLabel(java.util.Iterator<java.lang.String> iterL)

      Returns a Collection of labels of the node for the specified language

      If there are no labels in the specified language the function returns the first label found for the next language in the iterator of languages received as a parameter

      If there are no labels the function returns a string representation of the concept QName

      If there are multiple labels then the function returns a Collection of all of them Applications would have to choose which one to use.

      Parameters:
        `iterL` - the iter l
      Returns:
        Collection<String>

    - #### getChildren

          public XBRLTreeNode[] getChildren()

      Obtain the chilren elements of this element in the hierarchy of this TreeWalker If this node has no children an empty array is returned This function does not return null.
      Returns:
        XBRLTreeNode[] Array of children elements in the order indicated by the order attribute

    - #### getWalker

          public XBRLTreeWalker getWalker()

      Returns the tree walker building the tree this node belongs to.
      Returns:
        XBRLTreeWalker

    - #### setNumber

          public void setNumber(int nodeSeq)

      Sets the number.
      Parameters:
        `nodeSeq` - the new number

    - #### getWeight

          public java.lang.String getWeight()

      Gets the weight.
      Returns:
        the weight

    - #### getParent

          public javax.swing.tree.MutableTreeNode getParent()

      Specified by:
        `getParent` in interface `javax.swing.tree.TreeNode`

    - #### getNodeName

          public java.lang.String getNodeName()

      Gets the node name.
      Returns:
        the node name

    - #### getPreferredLabelRole

          public XBRLRoleType getPreferredLabelRole()

      Gets the preferred label role.
      Returns:
        the preferred label role

    - #### getHash

          public java.lang.String getHash()

      Gets the hash.
      Returns:
        the hash

    - #### children

          public java.util.Enumeration<javax.swing.tree.MutableTreeNode> children()

      Specified by:
        `children` in interface `javax.swing.tree.TreeNode`

    - #### getAllowsChildren

          public boolean getAllowsChildren()

      Specified by:
        `getAllowsChildren` in interface `javax.swing.tree.TreeNode`

    - #### getChildAt

          public javax.swing.tree.TreeNode getChildAt(int childIndex)

      Specified by:
        `getChildAt` in interface `javax.swing.tree.TreeNode`

    - #### getChildCount

          public int getChildCount()

      Specified by:
        `getChildCount` in interface `javax.swing.tree.TreeNode`

    - #### getIndex

          public int getIndex(javax.swing.tree.TreeNode node)

      Specified by:
        `getIndex` in interface `javax.swing.tree.TreeNode`

    - #### isLeaf

          public boolean isLeaf()

      Specified by:
        `isLeaf` in interface `javax.swing.tree.TreeNode`

    - #### insert

          public void insert(javax.swing.tree.MutableTreeNode child,
                    int index)

      Specified by:
        `insert` in interface `javax.swing.tree.MutableTreeNode`

    - #### remove

          public void remove(int index)

      Specified by:
        `remove` in interface `javax.swing.tree.MutableTreeNode`

    - #### remove

          public void remove(javax.swing.tree.MutableTreeNode node)

      Specified by:
        `remove` in interface `javax.swing.tree.MutableTreeNode`

    - #### removeFromParent

          public void removeFromParent()

      Specified by:
        `removeFromParent` in interface `javax.swing.tree.MutableTreeNode`

    - #### setParent

          public void setParent(javax.swing.tree.MutableTreeNode newParent)

      Specified by:
        `setParent` in interface `javax.swing.tree.MutableTreeNode`

    - #### setUserObject

          public void setUserObject(java.lang.Object object)

      Specified by:
        `setUserObject` in interface `javax.swing.tree.MutableTreeNode`