⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 level.java

📁 JAVA实现的一个类库
💻 JAVA
字号:
package cn.edu.nju.software.sd.cll;/** * inheritance from the Priority Class *  * @author SuSE * */public class Level extends Priority {    /**     * The value seems like the configuration of Log4j     */    public static final int TRACE_INT = 5000;    /**     * The function of FATAL,level is not a value.     *      */	public static final  Level FATAL = new Level(FATAL_INT, "FATAL")   ;  	   /**     * The function of FATAL,level is not a value.     *      */	public final static Level ERROR = new Level(ERROR_INT, "ERROR");  	   /**     * The function of ERROR,level is not a value.     *      */	public final static Level WARNING = new Level(WARNING_INT, "WARN");	   /**     * The function of WARNING,level is not a value.     *      */	public final static Level INFO = new Level(INFO_INT, "INFO");	   /**     * The function of INFO,level is not a value.     *      */	public final static Level DEBUG = new Level(DEBUG_INT, "DEBUG");	   /**     * The function of DEBUG,level is not a value.     *      */        public static final Level TRACE=new Level(TRACE_INT, "TRACE" );         //Following two are not to be hiden. 	   /**         * The function of OFF,level is not a value.         *          */         public final static  Level OFF = new Level(OFF_INT, "OFF");           	     /**          * The function of ALL,level is not a value.          *           */         public final static Level ALL = new Level(ALL_INT, "ALL" );            protected  Level(int levelNo, String levelStr  ) {    super(levelNo, levelStr );  }    /**     * toLevel function to generate a Level object.     * @param sArg     * @return     */   public static  Level toLevel(String sArg) {    return (Level) toLevel(sArg, Level.DEBUG);  }   /**    *  toLevel function to generate a Level object.    * @param val    * @return    */  public  static  Level toLevel(int val) {    return (Level) toLevel(val, Level.DEBUG);  }  /**   *  toLevel function to generate a Level object.   * @param val   * @param defaultLevel   * @return   */    public static     Level toLevel(int val, Level defaultLevel) {    switch(val) {    case ALL_INT: return ALL;    case DEBUG_INT: return Level.DEBUG;    case INFO_INT: return Level.INFO;    case WARNING_INT: return Level.WARNING;    case ERROR_INT: return Level.ERROR;    case FATAL_INT: return Level.FATAL;    case TRACE_INT: return Level.TRACE;       case OFF_INT: return OFF;        default: return defaultLevel;    }  }        /**     *  toLevel function to generate a Level object.     * @param val     * @param defaultLevel     * @return     */   public  static  Level toLevel(String sArg, Level defaultLevel) {                      if(sArg == null)       return defaultLevel;        String s = sArg.toUpperCase();    if(s.equals("ALL")) return Level.ALL;     if(s.equals("DEBUG")) return Level.DEBUG;     if(s.equals("INFO"))  return Level.INFO;    if(s.equals("WARNING"))  return Level.WARNING;      if(s.equals("ERROR")) return Level.ERROR;    if(s.equals("FATAL")) return Level.FATAL;    if(s.equals("OFF")) return Level.OFF;    if(s.equals("TRACE")) return Level.TRACE;    //    //   For Turkish i problem, see bug 40937    //    if(s.equals("\u0130NFO")) return Level.INFO;    return defaultLevel;  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -