1
2
3
4
5
6
7
8 package org.astrogrid.registry.beans.resource.votable;
9
10
11
12
13
14 import java.io.Serializable;
15 import java.util.ArrayList;
16 import java.util.Enumeration;
17 import org.exolab.castor.xml.Marshaller;
18 import org.exolab.castor.xml.Unmarshaller;
19
20 /***
21 * Class FIELDItem.
22 *
23 * @version $Revision: 1.14 $ $Date: 2007/01/04 16:26:13 $
24 */
25 public class FIELDItem implements java.io.Serializable {
26
27
28
29
30
31
32 /***
33 * Field _DESCRIPTION
34 */
35 private org.astrogrid.registry.beans.resource.votable.AnyTEXT _DESCRIPTION;
36
37 /***
38 * Field _VALUESList
39 */
40 private java.util.ArrayList _VALUESList;
41
42 /***
43 * Field _LINK
44 */
45 private org.astrogrid.registry.beans.resource.votable.LINK _LINK;
46
47
48
49
50
51
52 public FIELDItem() {
53 super();
54 _VALUESList = new ArrayList();
55 }
56
57
58
59
60
61
62 /***
63 * Method addVALUES
64 *
65 * @param vVALUES
66 */
67 public void addVALUES(org.astrogrid.registry.beans.resource.votable.VALUES vVALUES)
68 throws java.lang.IndexOutOfBoundsException
69 {
70 if (!(_VALUESList.size() < 2)) {
71 throw new IndexOutOfBoundsException();
72 }
73 _VALUESList.add(vVALUES);
74 }
75
76 /***
77 * Method addVALUES
78 *
79 * @param index
80 * @param vVALUES
81 */
82 public void addVALUES(int index, org.astrogrid.registry.beans.resource.votable.VALUES vVALUES)
83 throws java.lang.IndexOutOfBoundsException
84 {
85 if (!(_VALUESList.size() < 2)) {
86 throw new IndexOutOfBoundsException();
87 }
88 _VALUESList.add(index, vVALUES);
89 }
90
91 /***
92 * Method clearVALUES
93 */
94 public void clearVALUES()
95 {
96 _VALUESList.clear();
97 }
98
99 /***
100 * Method enumerateVALUES
101 */
102 public java.util.Enumeration enumerateVALUES()
103 {
104 return new org.exolab.castor.util.IteratorEnumeration(_VALUESList.iterator());
105 }
106
107 /***
108 * Returns the value of field 'DESCRIPTION'.
109 *
110 * @return the value of field 'DESCRIPTION'.
111 */
112 public org.astrogrid.registry.beans.resource.votable.AnyTEXT getDESCRIPTION()
113 {
114 return this._DESCRIPTION;
115 }
116
117 /***
118 * Returns the value of field 'LINK'.
119 *
120 * @return the value of field 'LINK'.
121 */
122 public org.astrogrid.registry.beans.resource.votable.LINK getLINK()
123 {
124 return this._LINK;
125 }
126
127 /***
128 * Method getVALUES
129 *
130 * @param index
131 */
132 public org.astrogrid.registry.beans.resource.votable.VALUES getVALUES(int index)
133 throws java.lang.IndexOutOfBoundsException
134 {
135
136 if ((index < 0) || (index > _VALUESList.size())) {
137 throw new IndexOutOfBoundsException();
138 }
139
140 return (org.astrogrid.registry.beans.resource.votable.VALUES) _VALUESList.get(index);
141 }
142
143 /***
144 * Method getVALUES
145 */
146 public org.astrogrid.registry.beans.resource.votable.VALUES[] getVALUES()
147 {
148 int size = _VALUESList.size();
149 org.astrogrid.registry.beans.resource.votable.VALUES[] mArray = new org.astrogrid.registry.beans.resource.votable.VALUES[size];
150 for (int index = 0; index < size; index++) {
151 mArray[index] = (org.astrogrid.registry.beans.resource.votable.VALUES) _VALUESList.get(index);
152 }
153 return mArray;
154 }
155
156 /***
157 * Method getVALUESCount
158 */
159 public int getVALUESCount()
160 {
161 return _VALUESList.size();
162 }
163
164 /***
165 * Method removeVALUES
166 *
167 * @param vVALUES
168 */
169 public boolean removeVALUES(org.astrogrid.registry.beans.resource.votable.VALUES vVALUES)
170 {
171 boolean removed = _VALUESList.remove(vVALUES);
172 return removed;
173 }
174
175 /***
176 * Sets the value of field 'DESCRIPTION'.
177 *
178 * @param DESCRIPTION the value of field 'DESCRIPTION'.
179 */
180 public void setDESCRIPTION(org.astrogrid.registry.beans.resource.votable.AnyTEXT DESCRIPTION)
181 {
182 this._DESCRIPTION = DESCRIPTION;
183 }
184
185 /***
186 * Sets the value of field 'LINK'.
187 *
188 * @param LINK the value of field 'LINK'.
189 */
190 public void setLINK(org.astrogrid.registry.beans.resource.votable.LINK LINK)
191 {
192 this._LINK = LINK;
193 }
194
195 /***
196 * Method setVALUES
197 *
198 * @param index
199 * @param vVALUES
200 */
201 public void setVALUES(int index, org.astrogrid.registry.beans.resource.votable.VALUES vVALUES)
202 throws java.lang.IndexOutOfBoundsException
203 {
204
205 if ((index < 0) || (index > _VALUESList.size())) {
206 throw new IndexOutOfBoundsException();
207 }
208 if (!(index < 2)) {
209 throw new IndexOutOfBoundsException();
210 }
211 _VALUESList.set(index, vVALUES);
212 }
213
214 /***
215 * Method setVALUES
216 *
217 * @param VALUESArray
218 */
219 public void setVALUES(org.astrogrid.registry.beans.resource.votable.VALUES[] VALUESArray)
220 {
221
222 _VALUESList.clear();
223 for (int i = 0; i < VALUESArray.length; i++) {
224 _VALUESList.add(VALUESArray[i]);
225 }
226 }
227
228 }