HiRISE

HiRISE.HiPlan.HiWeb
Class SuggestedObservation.PriorityComparator

java.lang.Object
  extended by HiRISE.HiPlan.HiWeb.SuggestedObservation.PriorityComparator
All Implemented Interfaces:
Comparator<String>
Enclosing class:
SuggestedObservation

public static class SuggestedObservation.PriorityComparator
extends Object
implements Comparator<String>

A comparator for priority values that sorts them in a preferred order, via their numerical prefix.

See Also:
MapComboBoxModel.MapComboBoxModel(Map,Comparator)

Constructor Summary
SuggestedObservation.PriorityComparator()
           
 
Method Summary
 int compare(String o1, String o2)
          Compares two strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

SuggestedObservation.PriorityComparator

public SuggestedObservation.PriorityComparator()
Method Detail

compare

public int compare(String o1,
                   String o2)
Compares two strings. If both strings start with an integer, they are sorted via that integer. Otherwise, they are reverse sorted alphabetically.

Specified by:
compare in interface Comparator<String>
Parameters:
o1 - the first string to compare.
o2 - the second string to compare.
Returns:
a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona