org.acm.seguin.pretty.sort
Class TopLevelOrdering

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

public class TopLevelOrdering
extends Ordering

Sorts the items in a java file at the top level

Author:
Chris Seguin

Constructor Summary
TopLevelOrdering(net.sourceforge.jrefactory.ast.ASTCompilationUnit node, PrintData data)
          Constructor for the TopLevelOrdering object
 
Method Summary
 int compare(java.lang.Object one, java.lang.Object two)
          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

TopLevelOrdering

public TopLevelOrdering(net.sourceforge.jrefactory.ast.ASTCompilationUnit node,
                        PrintData data)
Constructor for the TopLevelOrdering object

Parameters:
node - Description of the Parameter
data - Description of the Parameter
Method Detail

compare

public int compare(java.lang.Object one,
                   java.lang.Object two)
Description of the Method

Specified by:
compare in interface java.util.Comparator
Overrides:
compare in class Ordering
Parameters:
one - Description of the Parameter
two - Description of the Parameter
Returns:
Description of the Return 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