01: package org.incava.qualog;
02:
03: import java.io.*;
04: import java.util.*;
05:
06: /**
07: * <p>Represents a logging/output level. Is essentially a wrapper around an
08: * Integer.</p>
09: */
10: class QlLevel implements Comparable {
11: private Integer level = null;
12:
13: public QlLevel(int level) {
14: this (new Integer(level));
15: }
16:
17: public QlLevel(Integer level) {
18: this .level = level;
19: }
20:
21: public int compareTo(Object other) {
22: if (other instanceof QlLevel) {
23: QlLevel qother = (QlLevel) other;
24: return this .level.compareTo(qother.level);
25: } else {
26: return -1;
27: }
28: }
29:
30: public boolean equals(Object other) {
31: return compareTo(other) == 0;
32: }
33:
34: public String toString() {
35: return level.toString();
36: }
37:
38: }
|