1
2
3
4
5
6
7
8 package fr.in2p3.jsaga.engine.schema.config.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
22
23
24
25 public class SetOperationType implements java.io.Serializable {
26
27
28
29
30
31
32
33
34
35 public static final int UNION_TYPE = 0;
36
37
38
39
40 public static final SetOperationType UNION = new SetOperationType(UNION_TYPE, "union");
41
42
43
44
45 public static final int INTERSECTION_TYPE = 1;
46
47
48
49
50 public static final SetOperationType INTERSECTION = new SetOperationType(INTERSECTION_TYPE, "intersection");
51
52
53
54
55 public static final int SUBSTRACTION_TYPE = 2;
56
57
58
59
60 public static final SetOperationType SUBSTRACTION = new SetOperationType(SUBSTRACTION_TYPE, "substraction");
61
62
63
64
65 private static java.util.Hashtable _memberTable = init();
66
67
68
69
70 private int type = -1;
71
72
73
74
75 private java.lang.String stringValue = null;
76
77
78
79
80
81
82 private SetOperationType(int type, java.lang.String value)
83 {
84 super();
85 this.type = type;
86 this.stringValue = value;
87 }
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102 public static java.util.Enumeration enumerate()
103 {
104 return _memberTable.elements();
105 }
106
107
108
109
110
111
112
113
114 public int getType()
115 {
116 return this.type;
117 }
118
119
120
121
122
123
124
125
126 private static java.util.Hashtable init()
127 {
128 Hashtable members = new Hashtable();
129 members.put("union", UNION);
130 members.put("intersection", INTERSECTION);
131 members.put("substraction", SUBSTRACTION);
132 return members;
133 }
134
135
136
137
138
139
140
141
142
143
144 private java.lang.Object readResolve()
145 {
146 return valueOf(this.stringValue);
147 }
148
149
150
151
152
153
154
155
156 public java.lang.String toString()
157 {
158 return this.stringValue;
159 }
160
161
162
163
164
165
166
167
168
169
170 public static fr.in2p3.jsaga.engine.schema.config.types.SetOperationType valueOf(java.lang.String string)
171 {
172 java.lang.Object obj = null;
173 if (string != null) obj = _memberTable.get(string);
174 if (obj == null) {
175 String err = "'" + string + "' is not a valid SetOperationType";
176 throw new IllegalArgumentException(err);
177 }
178 return (SetOperationType) obj;
179 }
180
181 }