org.acm.seguin.pretty.sort
Class StaticOrder

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

public class StaticOrder
extends Ordering

Orders the items in a class according to type.

Author:
Chris Seguin, Mike Atkinson

Constructor Summary
StaticOrder(java.lang.String ordering)
          Constructor for the StaticOrder object
 
Method Summary
protected  int getIndex(java.lang.Object object)
          Return the index of the item in the order array
 
Methods inherited from class org.acm.seguin.pretty.sort.Ordering
compare
 
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

StaticOrder

public StaticOrder(java.lang.String ordering)
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

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