KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > omg > uml > foundation > datatypes > OrderingKindEnum


1 package org.omg.uml.foundation.datatypes;
2
3 public final class OrderingKindEnum implements OrderingKind {
4     public static final OrderingKindEnum OK_UNORDERED = new OrderingKindEnum("ok_unordered");
5     public static final OrderingKindEnum OK_ORDERED = new OrderingKindEnum("ok_ordered");
6
7     private static final java.util.List JavaDoc typeName;
8     private final java.lang.String JavaDoc literalName;
9
10     static {
11         java.util.ArrayList JavaDoc temp = new java.util.ArrayList JavaDoc();
12         temp.add("Data_Types");
13         temp.add("OrderingKind");
14         typeName = java.util.Collections.unmodifiableList(temp);
15     }
16
17     private OrderingKindEnum(java.lang.String JavaDoc literalName) {
18         this.literalName = literalName;
19     }
20
21     public java.util.List JavaDoc refTypeName() {
22         return typeName;
23     }
24
25     public java.lang.String JavaDoc toString() {
26         return literalName;
27     }
28
29     public int hashCode() {
30         return literalName.hashCode();
31     }
32
33     public boolean equals(java.lang.Object JavaDoc o) {
34         if (o instanceof OrderingKindEnum) return (o == this);
35         else if (o instanceof OrderingKind) return (o.toString().equals(literalName));
36         else return ((o instanceof javax.jmi.reflect.RefEnum) && ((javax.jmi.reflect.RefEnum) o).refTypeName().equals(typeName) && o.toString().equals(literalName));
37     }
38
39     public static OrderingKind forName(java.lang.String JavaDoc name) {
40         if (name.equals("ok_unordered")) return OK_UNORDERED;
41         if (name.equals("ok_ordered")) return OK_ORDERED;
42         throw new java.lang.IllegalArgumentException JavaDoc("Unknown literal name '" + name + "' for enumeration 'Data_Types.OrderingKind'");
43     }
44     protected java.lang.Object JavaDoc readResolve() throws java.io.ObjectStreamException JavaDoc {
45         try {
46             return forName(literalName);
47         } catch (java.lang.IllegalArgumentException JavaDoc e) {
48             throw new java.io.InvalidObjectException JavaDoc(e.getMessage());
49         }
50     }
51 }
52
Popular Tags