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 006package fc.io; 007 008import java.util.*; 009 010public class LogLevel 011{ 012public String desc; 013public int intval; 014 015protected 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. 022public 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 030public String toString() 031 { 032 return "LogLevel [" + intval + "," + desc + "]"; 033 } 034 035} //~LogLevel 036 037