SlowQueryReport.QueryStatsComparator (Apache Tomcat 9.0.37 API Documentation)

org.apache.tomcat.jdbc.pool.interceptor

## Class SlowQueryReport.QueryStatsComparator

- java.lang.Object
- - org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReport.QueryStatsComparator

- All Implemented Interfaces:
    Comparator<SlowQueryReport.QueryStats>
  Enclosing class:
    SlowQueryReport

      public static class SlowQueryReport.QueryStatsComparator
      extends Object
      implements Comparator<SlowQueryReport.QueryStats>

  Compare QueryStats by their lastInvocation value. QueryStats that have never been updated, have a lastInvocation value of `0` which should be handled as the newest possible invocation.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `QueryStatsComparator()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compare(SlowQueryReport.QueryStats stats1, SlowQueryReport.QueryStats stats2)`

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

    - #### QueryStatsComparator

          public QueryStatsComparator()

  - ### Method Detail

    - #### compare

          public int compare(SlowQueryReport.QueryStats stats1,
                             SlowQueryReport.QueryStats stats2)

      Specified by:
        `compare` in interface `Comparator<SlowQueryReport.QueryStats>`

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.