public class LevelComparator
extends java.lang.Object
implements java.util.Comparator
Constructor and Description |
---|
LevelComparator(SymbolTable table) |
Modifier and Type | Method and Description |
---|---|
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Compare two
SymbolID s to see which type is more refined. |
boolean |
equals(java.lang.Object obj)
The following equals method does not make sense for a sort
comparator.
|
public LevelComparator(SymbolTable table)
public final int compare(java.lang.Object o1, java.lang.Object o2)
SymbolID
s to see which type is more refined.
An object is considered lesser if there are more types in the type
hierarchy between it and the base exception type than the
object it is being compared with.compare
in interface java.util.Comparator
o1
- this should be a SymbolID
object.o2
- this should be a SymbolID
object.o1
has more types in the type hierarchy
between it and the base exception type than o2
.
1 if o1
has fewer types in the type hierarchy
between it and the base exception type than o2
.
Otherwise, 0 is returned.public final boolean equals(java.lang.Object obj)
false
.equals
in interface java.util.Comparator
equals
in class java.lang.Object
obj
- ignoredfalse