org.objectweb.util.monolog.wrapper.common
Class LevelImpl
java.lang.Object
org.objectweb.util.monolog.wrapper.common.LevelImpl
- Level, Serializable
public class LevelImpl
extends java.lang.Object
implements Level, Serializable
This class is the basic implementation of the Level interface. It proviedes
also a static method 'evaluate' which permits to obtain the integer value
of a level expression.
- Sebastien Chassande-Barrioz
int | compareTo(Level o) - Compares this object with the specified object for order.
|
static int | evaluate(String expr, LevelFactory lf) - It analyzes a string expression to obtain its integer value.
|
int | getIntValue() - Returns the integer value which represents the level.
|
String | getName() - It retrieves the name of the Level
|
String | getStringValue() - It retrieves the string expression of the level.
|
int | hashCode() - It retrieves the integer value of the level.
|
boolean | isComparableWith(Level o) - This method returns true is the current level and the Level parameter are
ordered.
|
void | setName(String n) - It assigns the name of the Level
|
String | toString()
|
LevelImpl
public LevelImpl(String n,
String val,
LevelFactory lf)
LevelImpl
public LevelImpl(String n,
int val)
compareTo
public int compareTo(Level o)
Compares this object with the specified object for order. Returns a
negative integer, zero, or a positive integer as this object is less than,
equal to, or greater than the specified object.
- compareTo in interface Level
evaluate
public static int evaluate(String expr,
LevelFactory lf)
It analyzes a string expression to obtain its integer value. The allowed
expression type are the following:
- an integer value
- another level name
- levelName + integerValue
- levelName - integerValue
expr
- is the string expression which must be evaluated.lf
- is the LevelFactory which permits to obtain the referenced level.
- an integer value or 0 if it is impossible to evaluate the
expression.
getIntValue
public int getIntValue()
Returns the integer value which represents the level.
- getIntValue in interface Level
getName
public String getName()
It retrieves the name of the Level
- getName in interface Level
getStringValue
public String getStringValue()
It retrieves the string expression of the level. ex: 'DEBUG + 1'
hashCode
public int hashCode()
It retrieves the integer value of the level.
isComparableWith
public boolean isComparableWith(Level o)
This method returns true is the current level and the Level parameter are
ordered.
- isComparableWith in interface Level
setName
public void setName(String n)
It assigns the name of the Level
- setName in interface Level
toString
public String toString()