1
2
3
4
5
6
7
8 package org.astrogrid.workflow.beans.v1.types;
9
10
11
12
13
14 import java.io.Serializable;
15 import java.util.Enumeration;
16 import java.util.Hashtable;
17 import org.exolab.castor.xml.Marshaller;
18 import org.exolab.castor.xml.Unmarshaller;
19
20 /***
21 * @deprecated not used any more
22 *
23 *
24 * @version $Revision: 1.30 $ $Date: 2007/01/04 16:26:37 $
25 */
26 public class JoinType implements java.io.Serializable {
27
28
29
30
31
32
33 /***
34 * The true type
35 */
36 public static final int TRUE_TYPE = 0;
37
38 /***
39 * The instance of the true type
40 */
41 public static final JoinType TRUE = new JoinType(TRUE_TYPE, "true");
42
43 /***
44 * The false type
45 */
46 public static final int FALSE_TYPE = 1;
47
48 /***
49 * The instance of the false type
50 */
51 public static final JoinType FALSE = new JoinType(FALSE_TYPE, "false");
52
53 /***
54 * The any type
55 */
56 public static final int ANY_TYPE = 2;
57
58 /***
59 * The instance of the any type
60 */
61 public static final JoinType ANY = new JoinType(ANY_TYPE, "any");
62
63 /***
64 * Field _memberTable
65 */
66 private static java.util.Hashtable _memberTable = init();
67
68 /***
69 * Field type
70 */
71 private int type = -1;
72
73 /***
74 * Field stringValue
75 */
76 private java.lang.String stringValue = null;
77
78
79
80
81
82
83 private JoinType(int type, java.lang.String value) {
84 super();
85 this.type = type;
86 this.stringValue = value;
87 }
88
89
90
91
92
93
94 /***
95 * Method enumerateReturns an enumeration of all possible
96 * instances of JoinType
97 */
98 public static java.util.Enumeration enumerate()
99 {
100 return _memberTable.elements();
101 }
102
103 /***
104 * Method getTypeReturns the type of this JoinType
105 */
106 public int getType()
107 {
108 return this.type;
109 }
110
111 /***
112 * Method init
113 */
114 private static java.util.Hashtable init()
115 {
116 Hashtable members = new Hashtable();
117 members.put("true", TRUE);
118 members.put("false", FALSE);
119 members.put("any", ANY);
120 return members;
121 }
122
123 /***
124 * Method toStringReturns the String representation of this
125 * JoinType
126 */
127 public java.lang.String toString()
128 {
129 return this.stringValue;
130 }
131
132 /***
133 * Method valueOfReturns a new JoinType based on the given
134 * String value.
135 *
136 * @param string
137 */
138 public static org.astrogrid.workflow.beans.v1.types.JoinType valueOf(java.lang.String string)
139 {
140 java.lang.Object obj = null;
141 if (string != null) obj = _memberTable.get(string);
142 if (obj == null) {
143 String err = "'" + string + "' is not a valid JoinType";
144 throw new IllegalArgumentException(err);
145 }
146 return (JoinType) obj;
147 }
148
149 }