gov.llnl.babel.backend

Class SortComparator

Implemented Interfaces:
Comparator

public class SortComparator
extends java.lang.Object
implements 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(Object o1, Object o2)
Compare two objects.
boolean
equals(Object obj)
The following equals method does not make sense for a sort comparator.

Method Details

compare

public int compare(Object o1,
                   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.

equals

public boolean equals(Object obj)
The following equals method does not make sense for a sort comparator. It always returns false.