org.acm.seguin.pretty.sort
Class FixupFinalStaticOrder

java.lang.Object
  extended by org.acm.seguin.pretty.sort.Ordering
      extended by org.acm.seguin.pretty.sort.FixupFinalStaticOrder
All Implemented Interfaces:
java.util.Comparator

public class FixupFinalStaticOrder
extends Ordering

Orders the items in a class according to dependencies for final static constants.

Since:
JRefactory 2.7.00
Author:
Mike Atkinson

Constructor Summary
FixupFinalStaticOrder()
          Constructor for the StaticOrder object
 
Method Summary
 int compare(java.lang.Object obj1, java.lang.Object obj2)
          Description of the Method
protected  int getIndex(java.lang.Object object)
          Return the index of the item in the order array
 
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

FixupFinalStaticOrder

public FixupFinalStaticOrder()
Constructor for the StaticOrder object

The string should either be "instance", "static", or "class". "instance" means that instance variables should go first. Either of the other two ordering strings indicate that the class variables or methods should go first.

Parameters:
ordering - A user specified string that describes the order.
Method Detail

compare

public int compare(java.lang.Object obj1,
                   java.lang.Object obj2)
Description of the Method

Specified by:
compare in interface java.util.Comparator
Overrides:
compare in class Ordering
Parameters:
obj1 - Description of Parameter
obj2 - Description of Parameter
Returns:
Description of the Returned Value

getIndex

protected int getIndex(java.lang.Object object)
Return the index of the item in the order array

Specified by:
getIndex in class Ordering
Parameters:
object - the object we are checking
Returns:
the objects index if it is found or 7 if it is not