001 // Copyright (c) 2001 Hursh Jain (http://www.mollypages.org) 002 // The Molly framework is freely distributable under the terms of an 003 // MIT-style license. For details, see the molly pages web site at: 004 // http://www.mollypages.org/. Use, modify, have fun ! 005 006 package fc.io; 007 008 import java.util.*; 009 010 public class LogLevel 011 { 012 public String desc; 013 public int intval; 014 015 protected LogLevel(String desc, int intval) 016 { 017 this.desc = desc; 018 this.intval = intval; 019 } 020 021 //remember, the static enums are instances too, so this method is possible. 022 public int compareTo(Object obj) 023 { 024 if ( (obj == null) || (!(obj instanceof LogLevel)) ) 025 return -1; 026 027 else return intval - ((LogLevel)obj).intval; 028 } 029 030 public String toString() 031 { 032 return "LogLevel [" + intval + "," + desc + "]"; 033 } 034 035 } //~LogLevel 036 037