KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.omg.uml.foundation.datatypes;
2
3 public final class MessageDirectionKindEnum implements MessageDirectionKind {
4     public static final MessageDirectionKindEnum MDK_ACTIVATION = new MessageDirectionKindEnum("mdk_activation");
5     public static final MessageDirectionKindEnum MDK_RETURN = new MessageDirectionKindEnum("mdk_return");
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("Foundation");
13         temp.add("Data_Types");
14         temp.add("MessageDirectionKind");
15         typeName = java.util.Collections.unmodifiableList(temp);
16     }
17
18     private MessageDirectionKindEnum(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 MessageDirectionKindEnum) return (o == this);
36         else if (o instanceof MessageDirectionKind) 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 MessageDirectionKind forName(java.lang.String JavaDoc name) {
41         if (name.equals("mdk_activation")) return MDK_ACTIVATION;
42         if (name.equals("mdk_return")) return MDK_RETURN;
43         throw new java.lang.IllegalArgumentException JavaDoc("Unknown literal name '" + name + "' for enumeration 'Foundation.Data_Types.MessageDirectionKind'");
44     }
45     protected java.lang.Object JavaDoc readResolve() throws java.io.ObjectStreamException JavaDoc {
46         try {
47             return forName(literalName);
48         } catch (java.lang.IllegalArgumentException JavaDoc e) {
49             throw new java.io.InvalidObjectException JavaDoc(e.getMessage());
50         }
51     }
52 }
53
Popular Tags