View Javadoc

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