ptolemy.domains.modal.modal
Class ModalRefinement.ClassComparator

java.lang.Object
  extended by ptolemy.domains.modal.modal.ModalRefinement.ClassComparator
All Implemented Interfaces:
java.util.Comparator<java.lang.Class<? extends Entity>>
Enclosing class:
ModalRefinement

private static class ModalRefinement.ClassComparator
extends java.lang.Object
implements java.util.Comparator<java.lang.Class<? extends Entity>>

A comparator to compare classes, which is used to sort the map returned by ModalRefinement._getRefinementClasses().

Since:
Ptolemy II 8.0
Version:
$Id: ModalRefinement.java 57046 2010-01-27 23:35:53Z cxh $
Author:
Thomas Huining Feng
Accepted Rating:
Red (tfeng)
Proposed Rating:
Red (tfeng)

Constructor Summary
private ModalRefinement.ClassComparator()
           
 
Method Summary
 int compare(java.lang.Class<? extends Entity> class1, java.lang.Class<? extends Entity> class2)
          Compare class1 and class2, and return -1 if class1 is a subclass of class2, 1 if class2 is a subclass of class1, and otherwise, the result of comparing the names of class1 and class2.
 
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

ModalRefinement.ClassComparator

private ModalRefinement.ClassComparator()
Method Detail

compare

public int compare(java.lang.Class<? extends Entity> class1,
                   java.lang.Class<? extends Entity> class2)
Compare class1 and class2, and return -1 if class1 is a subclass of class2, 1 if class2 is a subclass of class1, and otherwise, the result of comparing the names of class1 and class2.

Specified by:
compare in interface java.util.Comparator<java.lang.Class<? extends Entity>>
Parameters:
class1 - The first class.
class2 - The second class.
Returns:
-1, 0, or 1 representing whether class1 is less than, equal to, or greater than class2.