1 package org.incava.qualog; 2 3 import java.io.*; 4 import java.util.*; 5 6 7 11 class QlLevel implements Comparable 12 { 13 private Integer level = null; 14 15 public QlLevel(int level) 16 { 17 this(new Integer (level)); 18 } 19 20 public QlLevel(Integer level) 21 { 22 this.level = level; 23 } 24 25 public int compareTo(Object other) 26 { 27 if (other instanceof QlLevel) { 28 QlLevel qother = (QlLevel)other; 29 return this.level.compareTo(qother.level); 30 } 31 else { 32 return -1; 33 } 34 } 35 36 public boolean equals(Object other) 37 { 38 return compareTo(other) == 0; 39 } 40 41 public String toString() 42 { 43 return level.toString(); 44 } 45 46 } 47 | Popular Tags |