edu.cmu.sei.aadl.modelsupport
Class QuickSort

java.lang.Object
  extended by edu.cmu.sei.aadl.modelsupport.QuickSort

public class QuickSort
extends java.lang.Object

Quicksort class provides the ability to define a quicksort method with a condition that is specific to the object type. This is achieved by redefininng the compare(obj1,obj2) method. This method returns -1 if obj1 is less than obj2, 0 if they are equal, and 1 if obj1 is greater than obj2. The default implementation performs a srting comparison of the toString value of each object.

Author:
phf

Constructor Summary
QuickSort()
           
 
Method Summary
protected  int compare(java.lang.Object obj1, java.lang.Object obj2)
          this is the default implementation of the compare method It uses the string representation of the two objects to perform the comparison
 void quickSort(org.eclipse.emf.common.util.EList el)
          performs a quicksort on the EList according the the compare method the default compare method compares the striong representations of two objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuickSort

public QuickSort()
Method Detail

compare

protected int compare(java.lang.Object obj1,
                      java.lang.Object obj2)
this is the default implementation of the compare method It uses the string representation of the two objects to perform the comparison

Parameters:
obj1 - first object
obj2 - second object
Returns:
-1 if obj1 < obj2, 0 if equal, 1 if obj1 > obj2.

quickSort

public void quickSort(org.eclipse.emf.common.util.EList el)
performs a quicksort on the EList according the the compare method the default compare method compares the striong representations of two objects.

Parameters:
el -