Package adams.core.logging
Class LevelComparator
- java.lang.Object
-
- adams.core.logging.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 Summary
Constructors Constructor Description LevelComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(Level o1, Level o2)Compares its two arguments for order.protected IntegertoInteger(Level level)Turns the level into an integer representation.-
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
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
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:
comparein interfaceComparator<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.
-
-