KickJava   Java API By Example, From Geeks To Geeks.

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


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