com.inxar.jenesis.util
Class MemberComparator

java.lang.Object
  |
  +--com.inxar.jenesis.util.MemberComparator
All Implemented Interfaces:
java.util.Comparator

public class MemberComparator
extends java.lang.Object
implements java.util.Comparator

Comparator which is used to sort Members in a class.


Field Summary
protected static int CLASS
           
protected static int CONSTANT
           
protected static int CONSTRUCTOR
           
protected static int EQUAL
           
protected static int FIELD
           
protected static int GREATER
           
protected static int INTERFACE
           
protected static int LESS
           
protected static int METHOD
           
protected static int OTHER
           
protected static int STATIC_INIT
           
 
Constructor Summary
MemberComparator()
           
 
Method Summary
protected  int assignInt(java.lang.Object o)
           
 int compare(java.lang.Object o1, java.lang.Object o2)
           
protected  int compareBooleans(boolean b1, boolean b2)
          utility method to compare boolean state.
protected  int compareClasses(ClassDeclaration o1, ClassDeclaration o2)
           
protected  int compareConstructors(Constructor o1, Constructor o2)
           
protected  int compareFields(Field o1, Field o2)
           
protected  int compareInterfaces(Interface o1, Interface o2)
           
protected  int compareInts(int i1, int i2)
          utility method to compare integer state.
protected  int compareMethods(Method o1, Method o2)
           
protected  int compareStrings(java.lang.String s1, java.lang.String s2)
          utility method to compare strings.
 
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
 

Field Detail

CONSTANT

protected static final int CONSTANT

INTERFACE

protected static final int INTERFACE

CONSTRUCTOR

protected static final int CONSTRUCTOR

METHOD

protected static final int METHOD

FIELD

protected static final int FIELD

CLASS

protected static final int CLASS

STATIC_INIT

protected static final int STATIC_INIT

OTHER

protected static final int OTHER

EQUAL

protected static final int EQUAL

LESS

protected static final int LESS

GREATER

protected static final int GREATER
Constructor Detail

MemberComparator

public MemberComparator()
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Specified by:
compare in interface java.util.Comparator

compareClasses

protected int compareClasses(ClassDeclaration o1,
                             ClassDeclaration o2)

compareMethods

protected int compareMethods(Method o1,
                             Method o2)

compareFields

protected int compareFields(Field o1,
                            Field o2)

compareConstructors

protected int compareConstructors(Constructor o1,
                                  Constructor o2)

compareInterfaces

protected int compareInterfaces(Interface o1,
                                Interface o2)

compareStrings

protected int compareStrings(java.lang.String s1,
                             java.lang.String s2)
utility method to compare strings. uses jdk1.2's compareTo method. 'does s1 compared to s2', not the other way around.

compareBooleans

protected int compareBooleans(boolean b1,
                              boolean b2)
utility method to compare boolean state. If they are different, the first boolean arg (o1) is deemed GREATER if it is the true one.

compareInts

protected int compareInts(int i1,
                          int i2)
utility method to compare integer state. If they are different, the they are compared with GREATER deemed to the larger number.

assignInt

protected int assignInt(java.lang.Object o)