org.acm.seguin.pretty.sort
Class TypeOrder

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

public class TypeOrder
extends Ordering

Orders the items in a class according to type.

Author:
Chris Seguin, Mike Atkinson

Constructor Summary
TypeOrder(java.lang.String ordering)
          Constructor for the TypeOrder 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

TypeOrder

public TypeOrder(java.lang.String ordering)
Constructor for the TypeOrder object

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