ptolemy.domains.fsm.modal
Class ModalController.ClassComparator

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

private static class ModalController.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 ModalController._getRefinementClasses().

Since:
Ptolemy II 7.1
Version:
$Id: ModalController.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Thomas Huining Feng
Accepted Rating:
Red (tfeng)
Proposed Rating:
Red (tfeng)

Constructor Summary
private ModalController.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

ModalController.ClassComparator

private ModalController.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.