lv.lumii.layoutengine.flowLayout.horizontalOrdering.pqtree

## Class PQTreeNodeLevelComparator

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

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

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

  This class implements comparator that compares PQTreeNodes and considers first node smaller than second node if first node is in level with larger number than second node's level number.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PQTreeNodeLevelComparator()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compare(PQTreeNode n1, PQTreeNode n2)` This method returns the result of comparison the given PQTreeNodes.

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

    - #### PQTreeNodeLevelComparator

          public PQTreeNodeLevelComparator()

  - ### Method Detail

    - #### compare

          public int compare(PQTreeNode n1,
                             PQTreeNode n2)

      This method returns the result of comparison the given PQTreeNodes.
      Specified by:
        `compare` in interface `java.util.Comparator<PQTreeNode>`
      Parameters:
        `n1` - the first PQTreeNode to be compared.
        `n2` - the second PQTreeNode to be compared.
      Returns:
        the comparison code.