gov.llnl.babel.backend
Class SortComparator
java.lang.Object
gov.llnl.babel.backend.SortComparator
- All Implemented Interfaces:
- java.util.Comparator
public class SortComparator
- extends java.lang.Object
- implements java.util.Comparator
The SortComparator
class compares two objects of a variety
of concrete types for use in sorting. Currently supported object types
are map entries, methods, strings, and symbols. Map entries are sorted
on the key string value. Methods are sorted by method names. Strings
are sorted by string value. Symbols are sorted by fully qualified name.
Method Summary |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Compare two objects. |
boolean |
equals(java.lang.Object obj)
The following equals method does not make sense for a sort
comparator. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SortComparator
public SortComparator()
compare
public int compare(java.lang.Object o1,
java.lang.Object o2)
- Compare two objects. This method returns a negative one if o1 is
less than o2, 0 if they are the same, and 1 if o1 is greater than 02.
- Specified by:
compare
in interface java.util.Comparator
equals
public boolean equals(java.lang.Object obj)
- The following equals method does not make sense for a sort
comparator. It always returns false.
- Specified by:
equals
in interface java.util.Comparator
- Overrides:
equals
in class java.lang.Object