KickJava   Java API By Example, From Geeks To Geeks.

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


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