com.dlsc.flexgantt.model.scheduling

## Class ConstraintViolationMessageComparator

- java.lang.Object
- - com.dlsc.flexgantt.model.scheduling.ConstraintViolationMessageComparator

- All Implemented Interfaces:
    Comparator<ConstraintViolationMessage>

      public class ConstraintViolationMessageComparator
      extends Object
      implements Comparator<ConstraintViolationMessage>

  Sorts constraint violation messages based on the rows where the source timeline objects of the two violations are located. Using this comparator for sorting makes it possible to display the messages in the `MessageTable` in the order of their occurence in the Gantt chart.
  Since:
    2.1
  Author:
    Dirk Lemmermann

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConstraintViolationMessageComparator(TreeTable treeTable)` Constructs a new comparator, which will be based on the given tree table.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compare(ConstraintViolationMessage m1, ConstraintViolationMessage m2)`

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

      `clone, equals, finalize, 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

    - #### ConstraintViolationMessageComparator

          public ConstraintViolationMessageComparator(TreeTable treeTable)

      Constructs a new comparator, which will be based on the given tree table.
      Parameters:
        `treeTable` - the tree table used for looking up the row indices for the sorted constraint violation messages

  - ### Method Detail

    - #### compare

          public int compare(ConstraintViolationMessage m1,
                             ConstraintViolationMessage m2)

      Specified by:
        `compare` in interface `Comparator<ConstraintViolationMessage>`

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.