lv.lumii.layoutengine.flowLayout.horizontalOrdering.pqtree

## Class PQTreeNodeStableComparator

- java.lang.Object
- - lv.lumii.layoutengine.flowLayout.horizontalOrdering.pqtree.PQTreeNodeStableComparator

- All Implemented Interfaces:
    java.util.Comparator<PQTreeNode>

      public class PQTreeNodeStableComparator
      extends java.lang.Object
      implements java.util.Comparator<PQTreeNode>

  This class implements comparator that compares two PQ tree nodes and considers first node smaller than second if none of both nodes are in new node set or if at least one of nodes are in new node set and PQTreeSeqComparator considers first node smaller or equal than second.
  See Also:
    `PQTreeSeqComparator`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PQTreeNodeStableComparator(java.util.Set<PQTreeNode> newNodeSet, java.util.List<? extends PQTreeNode> oldOrder)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compare(PQTreeNode o1, PQTreeNode o2)` This method returns the result of comparison the given PQ tree nodes.

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

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

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

      `comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

- - ### Constructor Detail

    - #### PQTreeNodeStableComparator

          public PQTreeNodeStableComparator(java.util.Set<PQTreeNode> newNodeSet,
                                            java.util.List<? extends PQTreeNode> oldOrder)

  - ### Method Detail

    - #### compare

          public int compare(PQTreeNode o1,
                             PQTreeNode o2)

      This method returns the result of comparison the given PQ tree nodes.
      Specified by:
        `compare` in interface `java.util.Comparator<PQTreeNode>`
      Parameters:
        `o1` - the first PQTreeNode to be compared.
        `o2` - the second PQTreeNode to be compared.
      Returns:
        the comparison code.