1 /*
2 * This class was automatically generated with
3 * <a href="http://castor.exolab.org">Castor 0.9.4</a>, using an
4 * XML Schema.
5 * $Id$
6 */
7
8 package org.enableit.db.beans;
9
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
13
14 import java.io.IOException;
15 import java.io.Reader;
16 import java.io.Serializable;
17 import java.io.Writer;
18 import java.util.Enumeration;
19 import java.util.Vector;
20 import org.exolab.castor.xml.*;
21 import org.exolab.castor.xml.MarshalException;
22 import org.exolab.castor.xml.ValidationException;
23 import org.xml.sax.ContentHandler;
24
25 /***
26 *
27 *
28 * @version $Revision$ $Date$
29 **/
30 public class Row implements java.io.Serializable {
31
32
33 //--------------------------/
34 //- Class/Member Variables -/
35 //--------------------------/
36
37 private java.util.Vector _colList;
38
39
40 //----------------/
41 //- Constructors -/
42 //----------------/
43
44 public Row() {
45 super();
46 _colList = new Vector();
47 } //-- org.enableit.db.beans.Row()
48
49
50 //-----------/
51 //- Methods -/
52 //-----------/
53
54 /***
55 *
56 *
57 * @param vCol
58 **/
59 public void addCol(Col vCol)
60 throws java.lang.IndexOutOfBoundsException
61 {
62 _colList.addElement(vCol);
63 } //-- void addCol(Col)
64
65 /***
66 *
67 *
68 * @param index
69 * @param vCol
70 **/
71 public void addCol(int index, Col vCol)
72 throws java.lang.IndexOutOfBoundsException
73 {
74 _colList.insertElementAt(vCol, index);
75 } //-- void addCol(int, Col)
76
77 /***
78 **/
79 public java.util.Enumeration enumerateCol()
80 {
81 return _colList.elements();
82 } //-- java.util.Enumeration enumerateCol()
83
84 /***
85 *
86 *
87 * @param index
88 **/
89 public Col getCol(int index)
90 throws java.lang.IndexOutOfBoundsException
91 {
92 //-- check bounds for index
93 if ((index < 0) || (index > _colList.size())) {
94 throw new IndexOutOfBoundsException();
95 }
96
97 return (Col) _colList.elementAt(index);
98 } //-- Col getCol(int)
99
100 /***
101 **/
102 public Col[] getCol()
103 {
104 int size = _colList.size();
105 Col[] mArray = new Col[size];
106 for (int index = 0; index < size; index++) {
107 mArray[index] = (Col) _colList.elementAt(index);
108 }
109 return mArray;
110 } //-- Col[] getCol()
111
112 /***
113 **/
114 public int getColCount()
115 {
116 return _colList.size();
117 } //-- int getColCount()
118
119 /***
120 **/
121 public boolean isValid()
122 {
123 try {
124 validate();
125 }
126 catch (org.exolab.castor.xml.ValidationException vex) {
127 return false;
128 }
129 return true;
130 } //-- boolean isValid()
131
132 /***
133 *
134 *
135 * @param out
136 **/
137 public void marshal(java.io.Writer out)
138 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
139 {
140
141 Marshaller.marshal(this, out);
142 } //-- void marshal(java.io.Writer)
143
144 /***
145 *
146 *
147 * @param handler
148 **/
149 public void marshal(org.xml.sax.ContentHandler handler)
150 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
151 {
152
153 Marshaller.marshal(this, handler);
154 } //-- void marshal(org.xml.sax.ContentHandler)
155
156 /***
157 **/
158 public void removeAllCol()
159 {
160 _colList.removeAllElements();
161 } //-- void removeAllCol()
162
163 /***
164 *
165 *
166 * @param index
167 **/
168 public Col removeCol(int index)
169 {
170 java.lang.Object obj = _colList.elementAt(index);
171 _colList.removeElementAt(index);
172 return (Col) obj;
173 } //-- Col removeCol(int)
174
175 /***
176 *
177 *
178 * @param index
179 * @param vCol
180 **/
181 public void setCol(int index, Col vCol)
182 throws java.lang.IndexOutOfBoundsException
183 {
184 //-- check bounds for index
185 if ((index < 0) || (index > _colList.size())) {
186 throw new IndexOutOfBoundsException();
187 }
188 _colList.setElementAt(vCol, index);
189 } //-- void setCol(int, Col)
190
191 /***
192 *
193 *
194 * @param colArray
195 **/
196 public void setCol(Col[] colArray)
197 {
198 //-- copy array
199 _colList.removeAllElements();
200 for (int i = 0; i < colArray.length; i++) {
201 _colList.addElement(colArray[i]);
202 }
203 } //-- void setCol(Col)
204
205 /***
206 *
207 *
208 * @param reader
209 **/
210 public static org.enableit.db.beans.Row unmarshal(java.io.Reader reader)
211 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
212 {
213 return (org.enableit.db.beans.Row) Unmarshaller.unmarshal(org.enableit.db.beans.Row.class, reader);
214 } //-- org.enableit.db.beans.Row unmarshal(java.io.Reader)
215
216 /***
217 **/
218 public void validate()
219 throws org.exolab.castor.xml.ValidationException
220 {
221 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
222 validator.validate(this);
223 } //-- void validate()
224
225 }
This page was automatically generated by Maven