Hello All,
    I have an enum in which I'm trying to use it's natural ordering.
In the javadocs for the java enum I get that it's based on the order
the enum constants are declared so if I declare an animal enum as:

DOG,
CAT;

then using DOG.compareTo(CAT) will tell me that dog comes before cat.
Where if i declare them as:

CAT,
DOG;

then using DOG.compareTo(CAT) will tell me that cat comes before dog.

My question is, Does the GWT compiled version of Java's Enum support
this same feature?

Thanks in advance


JAVADOC FOR REFERENCE:
public final int compareTo(E o)

    Compares this enum with the specified object for order. Returns a
negative integer, zero, or a positive integer as this object is less
than, equal to, or greater than the specified object. Enum constants
are only comparable to other enum constants of the same enum type. The
natural order implemented by this method is the order in which the
constants are declared.

    Specified by:
        compareTo in interface Comparable<E extends Enum<E>>

    Parameters:
        o - the object to be compared.
    Returns:
        a negative integer, zero, or a positive integer as this object
is less than, equal to, or greater than the specified object.


-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to