lv.lumii.layoutengine.flowLayout.horizontalOrdering.pqtree

## Class PQTreeList<T>

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractList<E>
    - - java.util.ArrayList<PQTree<T>>
      - - lv.lumii.layoutengine.flowLayout.horizontalOrdering.pqtree.PQTreeList<T>

- Type Parameters:
    `T` - object type
  All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<PQTree<T>>, java.util.Collection<PQTree<T>>, java.util.List<PQTree<T>>, java.util.RandomAccess

      public class PQTreeList<T>
      extends java.util.ArrayList<PQTree<T>>

  This class implements list of PQ-Trees that support all list operations and several others. All these special operations lighten work with rules that applies to several trees. Rules are applied separately for each tree and they are merged together if needed.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PQTreeList()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRule(java.util.Collection<T> ruleObjectSet)` This method adds new rule to one of trees in this list.
    `void` | `addTree(PQTree<T> tree)` This method adds new PQTree to this list.
    `void` | `addTree(T o, int LLValue)` This method adds new PQTree to this list.
    `int` | `calculateMLValue(java.util.Set s)` This method calculates ML value for given set of original graph nodes.
    `void` | `calculateMLValues(PQTree<T> tree)` This method calculates correct ML values of given PQ-tree.
    `boolean` | `checkValidity()` This method checks consistency of information.
    `void` | `clearUserObjects()` This method clears user objects from each tree in this tree list.
    `void` | `copy(PQTreeList<T> originallist)` This method that copies all trees from another PQTreeList.
    `LayeredGraph` | `getLayeredGraph()` This method gets layered graph.
    `java.util.LinkedList<T>` | `getList(java.util.List<? extends java.util.Set<T>> sequenceRulesList)` This method gets correct node list of all objects.
    `PQTree<T>` | `getTree(int index)` This method returns tree that is in given place in this list.
    `void` | `merge(java.util.List<T> list)` This method merges all trees that contains objects in list.
    `void` | `print()` This method prints all PQ-trees in this list.
    `void` | `removeEmptyTrees()` This method removes all trees that doesn't contain any CNode.
    `void` | `removeNodes(java.util.Collection<T> c)` This method removes unnecessary nodes from all graphs.
    `void` | `removeUnnecessary()` This method removes all unnecessary nodes from each tree in the list.
    `void` | `replace(T existingObject, T newObject)` This method replaces one object with another in correct PQTree.
    `void` | `replaceList(java.util.List<T> list, T o)` This method replaces list of nodes with single node.
    `void` | `setHangingNodeSet(java.util.Set<T> s)` This method sets hanging node sets for each tree.
    `void` | `setInvisibleNodeSet(java.util.Set<T> s)` This method sets invisible node sets for each tree.
    `void` | `setLayeredGraph(LayeredGraph graph)` This method sets layered graph.
    `void` | `updateLevelInfo()` This method updates levl information for each tree in the list.

    - ### Methods inherited from class java.util.ArrayList

      `add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize`

    - ### Methods inherited from class java.util.AbstractList

      `equals, hashCode`

    - ### Methods inherited from class java.util.AbstractCollection

      `containsAll, toString`

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

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

    - ### Methods inherited from interface java.util.List

      `containsAll, equals, hashCode`

    - ### Methods inherited from interface java.util.Collection

      `parallelStream, stream`

- - ### Constructor Detail

    - #### PQTreeList

          public PQTreeList()

  - ### Method Detail

    - #### getTree

          public PQTree<T> getTree(int index)

      This method returns tree that is in given place in this list.
      Parameters:
        `index` - index of necessary tree.
      Returns:
        required PQTree.

    - #### addTree

          public void addTree(T o,
                              int LLValue)

      This method adds new PQTree to this list.
      Parameters:
        `o` - new object that will be the only one in new PQTree.
        `LLValue` - LL value on new PQTree.

    - #### addTree

          public void addTree(PQTree<T> tree)

      This method adds new PQTree to this list.
      Parameters:
        `tree` - PQTree object that will be added.

    - #### replace

          public void replace(T existingObject,
                              T newObject)

      This method replaces one object with another in correct PQTree.
      Parameters:
        `existingObject` - existing object that will be replaced.
        `newObject` - new object that will be added in place of existing one.

    - #### replaceList

          public void replaceList(java.util.List<T> list,
                                  T o)

      This method replaces list of nodes with single node.
      Parameters:
        `list` - list of objects that will be replaced.
        `o` - object to be inserted.

    - #### merge

          public void merge(java.util.List<T> list)

      This method merges all trees that contains objects in list.
      Parameters:
        `list` - list of objects that have to belong to the same tree after merge operation.

    - #### clearUserObjects

          public void clearUserObjects()

      This method clears user objects from each tree in this tree list.

    - #### addRule

          public void addRule(java.util.Collection<T> ruleObjectSet)

      This method adds new rule to one of trees in this list.
      Parameters:
        `ruleObjectSet` - set of objects that should be sequentially.

    - #### removeUnnecessary

          public void removeUnnecessary()

      This method removes all unnecessary nodes from each tree in the list.
      See Also:
        `PQTree`

    - #### copy

          public void copy(PQTreeList<T> originallist)

      This method that copies all trees from another PQTreeList.
      Parameters:
        `originallist` - tree list from which everything is copied.

    - #### updateLevelInfo

          public void updateLevelInfo()

      This method updates levl information for each tree in the list.

    - #### setInvisibleNodeSet

          public void setInvisibleNodeSet(java.util.Set<T> s)

      This method sets invisible node sets for each tree.
      Parameters:
        `s` - set of objects that are invisible nodes in original graph.

    - #### setHangingNodeSet

          public void setHangingNodeSet(java.util.Set<T> s)

      This method sets hanging node sets for each tree.
      Parameters:
        `s` - set of objects that are hanging nodes in original graph.

    - #### print

          public void print()

      This method prints all PQ-trees in this list.

    - #### getList

          public java.util.LinkedList<T> getList(java.util.List<? extends java.util.Set<T>> sequenceRulesList)

      This method gets correct node list of all objects. Correct node order is arbitrary if sequence rules is null, otherwise such ordering that corresponds sequence rules.
      Parameters:
        `sequenceRulesList` - - list of node sets that means that objects in i-th set have to be no further than objects from (i+1)-th set.
      Returns:
        List of nodes that represents node order.

    - #### calculateMLValues

          public void calculateMLValues(PQTree<T> tree)

      This method calculates correct ML values of given PQ-tree.
      Parameters:
        `tree` - PQ-tree which ML values will be calculated.

    - #### calculateMLValue

          public int calculateMLValue(java.util.Set s)

      This method calculates ML value for given set of original graph nodes.
      Parameters:
        `s` - set of nodes for whom ML (meet level) is calculated.
      Returns:
        index of meet level.

    - #### setLayeredGraph

          public void setLayeredGraph(LayeredGraph graph)

      This method sets layered graph.
      Parameters:
        `graph` - reference to new layered graph.

    - #### getLayeredGraph

          public LayeredGraph getLayeredGraph()

      This method gets layered graph.
      Returns:
        reference of layered graph.

    - #### removeNodes

          public void removeNodes(java.util.Collection<T> c)

      This method removes unnecessary nodes from all graphs.
      Parameters:
        `c` - collection of unnecessary nodes.

    - #### removeEmptyTrees

          public void removeEmptyTrees()

      This method removes all trees that doesn't contain any CNode.

    - #### checkValidity

          public boolean checkValidity()

      This method checks consistency of information.
      Returns:
        false if there exists object x that is in tree, but it isn't in object to tree mapping.