Class LevelComparator

  • All Implemented Interfaces:
    Comparator<Level>

    public class LevelComparator
    extends Object
    implements Comparator<Level>
    Comparator for logging levels.

    The following order is used:
     FINEST > FINER > FINE > CONFIG > INFO > WARNING > SEVERE > OFF
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • LevelComparator

        public LevelComparator()
    • Method Detail

      • toInteger

        protected Integer toInteger​(Level level)
        Turns the level into an integer representation.
        Parameters:
        level - the level to process
        Returns:
        the integer equivalent
      • compare

        public int compare​(Level o1,
                           Level o2)
        Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
        Specified by:
        compare in interface Comparator<Level>
        Parameters:
        o1 - the first object to be compared.
        o2 - the second object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.