astro
Class StarDescription.StarComparator<T extends StarDescription>
java.lang.Object
astro.StarDescription.StarComparator<T>
- All Implemented Interfaces:
- Comparator<T>
- Enclosing class:
- StarDescription
public static class StarDescription.StarComparator<T extends StarDescription>
- extends Object
- implements Comparator<T>
Gets a star definition comparator linked to the named property of the
star.
|
Method Summary |
int |
compare(T o1,
T o2)
Two stars are compared for their property named by the constructor
field. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
field
String field
ascending
int ascending
StarDescription.StarComparator
public StarDescription.StarComparator(String id)
- We compare the star for the field given. If those are not comparable,
we get them as a property.
StarDescription.StarComparator
public StarDescription.StarComparator(String id,
boolean asc)
- We compare the star for the field given. If those are not comparable,
we get them as a property.
compare
public int compare(T o1,
T o2)
- Two stars are compared for their property named by the constructor
field. If this is
StarDescription.RA, we sort ascending for RA, if this is
StarDescription.MAG, we sort for brightness.
- Specified by:
compare in interface Comparator<T extends StarDescription>