org.acm.seguin.pretty.sort
Class FieldInitializerOrder

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

public class FieldInitializerOrder
extends Ordering

The ordering is the basic tool to determine if the parse tree node is in the proper order. This object contains the base class for the order.

Author:
Chris Seguin

Constructor Summary
FieldInitializerOrder()
           
 
Method Summary
 int compare(java.lang.Object one, java.lang.Object two)
          Compare two items
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

FieldInitializerOrder

public FieldInitializerOrder()
Method Detail

compare

public int compare(java.lang.Object one,
                   java.lang.Object two)
Compare two items

Specified by:
compare in interface java.util.Comparator
Overrides:
compare in class Ordering
Parameters:
one - the first item
two - the second item
Returns:
1 if the first item is greater than the second, -1 if the first item is less than the second, and 0 otherwise.

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