gov.llnl.babel.backend
Class LevelComparator
java.lang.Object
gov.llnl.babel.backend.LevelComparator
- Comparator
public class LevelComparator
extends java.lang.Object
implements Comparator
int | compare(Object o1, Object o2) - Compare two
SymbolID s to see which type is more refined.
|
boolean | equals(Object obj) - The following equals method does not make sense for a sort
comparator.
|
LevelComparator
public LevelComparator(SymbolTable table)
compare
public final int compare(Object o1,
Object o2)
Compare two 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.
o1
- this should be a SymbolID
object.o2
- this should be a SymbolID
object.
- -1 if
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.
equals
public final boolean equals(Object obj)
The following equals method does not make sense for a sort
comparator. It always returns false
.