org.vishia.gral.base

## Class GralTable.NodeTableLine

- java.lang.Object
- - org.vishia.util.TreeNodeBase<GralTable.TableLineData,UserData,GralTableLine_ifc<UserData>>
  - - org.vishia.gral.base.GralTable.NodeTableLine

- All Implemented Interfaces:
    java.lang.Iterable<GralTable.TableLineData>, SortedTree<GralTableLine_ifc<UserData>>, TreeNode_ifc<GralTable.TableLineData,UserData>
  Direct Known Subclasses:
    GralTable.TableLineData
  Enclosing class:
    GralTable<UserData>

      public class GralTable.NodeTableLine
      extends TreeNodeBase<GralTable.TableLineData,UserData,GralTableLine_ifc<UserData>>

  This class is the super class of `GralTable.TableLineData` which presents a line as a node in a tree. Therefore it implements the `TreeNodeBase` interface. A line as parent node can be presented folded (default) or unfolded in several levels to present a tree instead a simple table.
  Only the `GralTable.rootLine` is a pure instance of this class The root line is never visible. It is the root. All other lines are instances of `GralTable.TableLineData` derived from this class.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.vishia.util.TreeNodeBase

      `TreeNodeBase.IteratorDerivedImpl, TreeNodeBase.IteratorDerivedNode, TreeNodeBase.IteratorImpl, TreeNodeBase.IteratorMetaNode, TreeNodeBase.IteratorOneNode, TreeNodeBase.MetaNode<DerivedNode extends TreeNodeBase<DerivedNode,Data,IfcType> & SortedTree<IfcType>,Data,IfcType extends SortedTree<IfcType>>, TreeNodeBase.TreeNode<Data>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) boolean` | `lineCanHaveChildren` True if it is known that the node has children.
    `(package private) boolean` | `showChildren` True if the children are shown in representation.
    `(package private) int` | `treeDepth` The deepness in the tree presentation of the data.
    `(package private) int` | `zLineUnfolded` Number of lines for this line and all visible children.

    - ### Fields inherited from class org.vishia.util.TreeNodeBase

      `data, firstChild, idxChildren, key, lastChild, leafData, next, nrofChildren, parent, prev, version`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NodeTableLine(java.lang.String key, UserData data)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `GralTable.TableLineData` | `addChildLine(java.lang.String lineKey, java.lang.String[] lineTexts, UserData userDataP)` Inserts a line as child of this.
    `GralTable.TableLineData` | `addNextLine(java.lang.String lineKey, java.lang.String[] lineTexts, UserData userDataP)` Inserts a line behind the current line.
    `GralTable.TableLineData` | `addPrevLine(java.lang.String lineKey, java.lang.String[] lineTexts, UserData userDataP)` Inserts a line before the current line.
    `(package private) void` | `adjCountChildrenInParent(int nCorr)`
    `(package private) void` | `clear()`
    `(package private) void` | `countChildren(boolean bLeftGrandChildrenOpen, int nrParent)`
    `(package private) void` | `countChildren(boolean bLeftGrandChildrenOpen, int nrParent, int recurs)` Counts the children and checks whether their childs should be shown.
    `void` | `deleteLine()`

    - ### Methods inherited from class org.vishia.util.TreeNodeBase

      `addLeaf, addNode, addNode, addNodeFirst, addSiblingNext, addSiblingPrev, childNodes, childNodes, detach, firstChild, getChild, getContainerChildren, getKey, getNode, getOrCreateNode, getParent, getParentData, hasChildren, iterator, iteratorChildren, iteratorChildren, iterChildren, iterChildren, lastChild, listChildren, listChildren, movetoFirstChild, movetoSiblingNext, movetoSiblingPrev, newNode, nextSibling, nrofChildren, parent, parentEquals, prevSibling, removeChildren, swap, toString, walkTree`

    - ### 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

    - #### zLineUnfolded

          int zLineUnfolded

      Number of lines for this line and all visible children.

    - #### treeDepth

          int treeDepth

      The deepness in the tree presentation of the data.

    - #### lineCanHaveChildren

          boolean lineCanHaveChildren

      True if it is known that the node has children. They may be unknown, then `#childLines` are null.

    - #### showChildren

          boolean showChildren

      True if the children are shown in representation.

  - ### Constructor Detail

    - #### NodeTableLine

          NodeTableLine(java.lang.String key,
                        UserData data)

  - ### Method Detail

    - #### clear

          void clear()

    - #### addChildLine

          public GralTable.TableLineData addChildLine(java.lang.String lineKey,
                                                      java.lang.String[] lineTexts,
                                                      UserData userDataP)

      Inserts a line as child of this. This method should be used if no child line exists yet. It adds as last line of children. If child lines are existent, one can use `addPrevLine(String, String[], Object)` or `addNextLine(String, String[], Object)` in respect to a given child line too.
      Parameters:
        `lineKey` - The key for the line
        `lineTexts` - maybe null, elsewhere texts for the cells (column texts) of the line.
        `userDataP` -
      Returns:
        the added line.

    - #### addPrevLine

          public GralTable.TableLineData addPrevLine(java.lang.String lineKey,
                                                     java.lang.String[] lineTexts,
                                                     UserData userDataP)

      Inserts a line before the current line.
      Parameters:
        `lineKey` - The key for the line
        `lineTexts` - maybe null, elsewhere texts for the cells (column texts) of the line.
        `userDataP` -
      Returns:
        the added line.

    - #### addNextLine

          public GralTable.TableLineData addNextLine(java.lang.String lineKey,
                                                     java.lang.String[] lineTexts,
                                                     UserData userDataP)

      Inserts a line behind the current line.
      Parameters:
        `lineKey` - The key for the line
        `lineTexts` - maybe null, elsewhere texts for the cells (column texts) of the line.
        `userDataP` -
      Returns:
        the added line.

    - #### deleteLine

          public void deleteLine()

    - #### countChildren

          void countChildren(boolean bLeftGrandChildrenOpen,
                             int nrParent)

    - #### countChildren

          void countChildren(boolean bLeftGrandChildrenOpen,
                             int nrParent,
                             int recurs)

      Counts the children and checks whether their childs should be shown. It checks and sets `GralTable.TableLineData.showChildren(boolean, boolean)`
      Parameters:
        `lineParent` -
        `bLeftGrandChildrenOpen` - false then set `GralTable.TableLineData.showChildren(boolean, boolean)` = false, true: count the grand children.
        `recurs` - more than 100 - prevent it.

    - #### adjCountChildrenInParent

          void adjCountChildrenInParent(int nCorr)