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 Index implements java.io.Serializable {
31  
32  
33        //--------------------------/
34       //- Class/Member Variables -/
35      //--------------------------/
36  
37      private java.lang.String _tableName;
38  
39      private java.lang.String _name;
40  
41      private java.lang.String _type;
42  
43      private java.lang.String _unique;
44  
45      private java.util.Vector _colNameList;
46  
47  
48        //----------------/
49       //- Constructors -/
50      //----------------/
51  
52      public Index() {
53          super();
54          _colNameList = new Vector();
55      } //-- org.enableit.db.beans.Index()
56  
57  
58        //-----------/
59       //- Methods -/
60      //-----------/
61  
62      /***
63       * 
64       * 
65       * @param vColName
66      **/
67      public void addColName(java.lang.String vColName)
68          throws java.lang.IndexOutOfBoundsException
69      {
70          _colNameList.addElement(vColName);
71      } //-- void addColName(java.lang.String) 
72  
73      /***
74       * 
75       * 
76       * @param index
77       * @param vColName
78      **/
79      public void addColName(int index, java.lang.String vColName)
80          throws java.lang.IndexOutOfBoundsException
81      {
82          _colNameList.insertElementAt(vColName, index);
83      } //-- void addColName(int, java.lang.String) 
84  
85      /***
86      **/
87      public java.util.Enumeration enumerateColName()
88      {
89          return _colNameList.elements();
90      } //-- java.util.Enumeration enumerateColName() 
91  
92      /***
93       * 
94       * 
95       * @param index
96      **/
97      public java.lang.String getColName(int index)
98          throws java.lang.IndexOutOfBoundsException
99      {
100         //-- check bounds for index
101         if ((index < 0) || (index > _colNameList.size())) {
102             throw new IndexOutOfBoundsException();
103         }
104         
105         return (String)_colNameList.elementAt(index);
106     } //-- java.lang.String getColName(int) 
107 
108     /***
109     **/
110     public java.lang.String[] getColName()
111     {
112         int size = _colNameList.size();
113         java.lang.String[] mArray = new java.lang.String[size];
114         for (int index = 0; index < size; index++) {
115             mArray[index] = (String)_colNameList.elementAt(index);
116         }
117         return mArray;
118     } //-- java.lang.String[] getColName() 
119 
120     /***
121     **/
122     public int getColNameCount()
123     {
124         return _colNameList.size();
125     } //-- int getColNameCount() 
126 
127     /***
128      * Returns the value of field 'name'.
129      * 
130      * @return the value of field 'name'.
131     **/
132     public java.lang.String getName()
133     {
134         return this._name;
135     } //-- java.lang.String getName() 
136 
137     /***
138      * Returns the value of field 'tableName'.
139      * 
140      * @return the value of field 'tableName'.
141     **/
142     public java.lang.String getTableName()
143     {
144         return this._tableName;
145     } //-- java.lang.String getTableName() 
146 
147     /***
148      * Returns the value of field 'type'.
149      * 
150      * @return the value of field 'type'.
151     **/
152     public java.lang.String getType()
153     {
154         return this._type;
155     } //-- java.lang.String getType() 
156 
157     /***
158      * Returns the value of field 'unique'.
159      * 
160      * @return the value of field 'unique'.
161     **/
162     public java.lang.String getUnique()
163     {
164         return this._unique;
165     } //-- java.lang.String getUnique() 
166 
167     /***
168     **/
169     public boolean isValid()
170     {
171         try {
172             validate();
173         }
174         catch (org.exolab.castor.xml.ValidationException vex) {
175             return false;
176         }
177         return true;
178     } //-- boolean isValid() 
179 
180     /***
181      * 
182      * 
183      * @param out
184     **/
185     public void marshal(java.io.Writer out)
186         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
187     {
188         
189         Marshaller.marshal(this, out);
190     } //-- void marshal(java.io.Writer) 
191 
192     /***
193      * 
194      * 
195      * @param handler
196     **/
197     public void marshal(org.xml.sax.ContentHandler handler)
198         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
199     {
200         
201         Marshaller.marshal(this, handler);
202     } //-- void marshal(org.xml.sax.ContentHandler) 
203 
204     /***
205     **/
206     public void removeAllColName()
207     {
208         _colNameList.removeAllElements();
209     } //-- void removeAllColName() 
210 
211     /***
212      * 
213      * 
214      * @param index
215     **/
216     public java.lang.String removeColName(int index)
217     {
218         java.lang.Object obj = _colNameList.elementAt(index);
219         _colNameList.removeElementAt(index);
220         return (String)obj;
221     } //-- java.lang.String removeColName(int) 
222 
223     /***
224      * 
225      * 
226      * @param index
227      * @param vColName
228     **/
229     public void setColName(int index, java.lang.String vColName)
230         throws java.lang.IndexOutOfBoundsException
231     {
232         //-- check bounds for index
233         if ((index < 0) || (index > _colNameList.size())) {
234             throw new IndexOutOfBoundsException();
235         }
236         _colNameList.setElementAt(vColName, index);
237     } //-- void setColName(int, java.lang.String) 
238 
239     /***
240      * 
241      * 
242      * @param colNameArray
243     **/
244     public void setColName(java.lang.String[] colNameArray)
245     {
246         //-- copy array
247         _colNameList.removeAllElements();
248         for (int i = 0; i < colNameArray.length; i++) {
249             _colNameList.addElement(colNameArray[i]);
250         }
251     } //-- void setColName(java.lang.String) 
252 
253     /***
254      * Sets the value of field 'name'.
255      * 
256      * @param name the value of field 'name'.
257     **/
258     public void setName(java.lang.String name)
259     {
260         this._name = name;
261     } //-- void setName(java.lang.String) 
262 
263     /***
264      * Sets the value of field 'tableName'.
265      * 
266      * @param tableName the value of field 'tableName'.
267     **/
268     public void setTableName(java.lang.String tableName)
269     {
270         this._tableName = tableName;
271     } //-- void setTableName(java.lang.String) 
272 
273     /***
274      * Sets the value of field 'type'.
275      * 
276      * @param type the value of field 'type'.
277     **/
278     public void setType(java.lang.String type)
279     {
280         this._type = type;
281     } //-- void setType(java.lang.String) 
282 
283     /***
284      * Sets the value of field 'unique'.
285      * 
286      * @param unique the value of field 'unique'.
287     **/
288     public void setUnique(java.lang.String unique)
289     {
290         this._unique = unique;
291     } //-- void setUnique(java.lang.String) 
292 
293     /***
294      * 
295      * 
296      * @param reader
297     **/
298     public static org.enableit.db.beans.Index unmarshal(java.io.Reader reader)
299         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
300     {
301         return (org.enableit.db.beans.Index) Unmarshaller.unmarshal(org.enableit.db.beans.Index.class, reader);
302     } //-- org.enableit.db.beans.Index unmarshal(java.io.Reader) 
303 
304     /***
305     **/
306     public void validate()
307         throws org.exolab.castor.xml.ValidationException
308     {
309         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
310         validator.validate(this);
311     } //-- void validate() 
312 
313 }
This page was automatically generated by Maven