KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jetspeed > xml > api > jcm > Topics


1 /*
2  * This class was automatically generated with
3  * <a HREF="http://castor.exolab.org">Castor 0.9.2</a>, using an
4  * XML Schema.
5  * $Id$
6  */

7
8 package org.apache.jetspeed.xml.api.jcm;
9
10   //---------------------------------/
11
//- Imported classes and packages -/
12
//---------------------------------/
13

14 import java.io.Reader JavaDoc;
15 import java.io.Serializable JavaDoc;
16 import java.io.Writer JavaDoc;
17 import java.util.Enumeration JavaDoc;
18 import java.util.Vector JavaDoc;
19 import org.exolab.castor.xml.*;
20 import org.exolab.castor.xml.MarshalException;
21 import org.exolab.castor.xml.ValidationException;
22 import org.xml.sax.DocumentHandler JavaDoc;
23
24 /**
25  *
26  * @version $Revision$ $Date$
27 **/

28 public class Topics implements java.io.Serializable JavaDoc {
29
30
31       //--------------------------/
32
//- Class/Member Variables -/
33
//--------------------------/
34

35     private java.util.Vector JavaDoc _entryList;
36
37
38       //----------------/
39
//- Constructors -/
40
//----------------/
41

42     public Topics() {
43         super();
44         _entryList = new Vector JavaDoc();
45     } //-- org.apache.jetspeed.xml.api.jcm.Topics()
46

47
48       //-----------/
49
//- Methods -/
50
//-----------/
51

52     /**
53      *
54      * @param vEntry
55     **/

56     public void addEntry(Entry vEntry)
57         throws java.lang.IndexOutOfBoundsException JavaDoc
58     {
59         _entryList.addElement(vEntry);
60     } //-- void addEntry(Entry)
61

62     /**
63     **/

64     public java.util.Enumeration JavaDoc enumerateEntry()
65     {
66         return _entryList.elements();
67     } //-- java.util.Enumeration enumerateEntry()
68

69     /**
70      *
71      * @param index
72     **/

73     public Entry getEntry(int index)
74         throws java.lang.IndexOutOfBoundsException JavaDoc
75     {
76         //-- check bounds for index
77
if ((index < 0) || (index > _entryList.size())) {
78             throw new IndexOutOfBoundsException JavaDoc();
79         }
80         
81         return (Entry) _entryList.elementAt(index);
82     } //-- Entry getEntry(int)
83

84     /**
85     **/

86     public Entry[] getEntry()
87     {
88         int size = _entryList.size();
89         Entry[] mArray = new Entry[size];
90         for (int index = 0; index < size; index++) {
91             mArray[index] = (Entry) _entryList.elementAt(index);
92         }
93         return mArray;
94     } //-- Entry[] getEntry()
95

96     /**
97     **/

98     public int getEntryCount()
99     {
100         return _entryList.size();
101     } //-- int getEntryCount()
102

103     /**
104     **/

105     public boolean isValid()
106     {
107         try {
108             validate();
109         }
110         catch (org.exolab.castor.xml.ValidationException vex) {
111             return false;
112         }
113         return true;
114     } //-- boolean isValid()
115

116     /**
117      *
118      * @param out
119     **/

120     public void marshal(java.io.Writer JavaDoc out)
121         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
122     {
123         
124         Marshaller.marshal(this, out);
125     } //-- void marshal(java.io.Writer)
126

127     /**
128      *
129      * @param handler
130     **/

131     public void marshal(org.xml.sax.DocumentHandler JavaDoc handler)
132         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
133     {
134         
135         Marshaller.marshal(this, handler);
136     } //-- void marshal(org.xml.sax.DocumentHandler)
137

138     /**
139     **/

140     public void removeAllEntry()
141     {
142         _entryList.removeAllElements();
143     } //-- void removeAllEntry()
144

145     /**
146      *
147      * @param index
148     **/

149     public Entry removeEntry(int index)
150     {
151         Object JavaDoc obj = _entryList.elementAt(index);
152         _entryList.removeElementAt(index);
153         return (Entry) obj;
154     } //-- Entry removeEntry(int)
155

156     /**
157      *
158      * @param index
159      * @param vEntry
160     **/

161     public void setEntry(int index, Entry vEntry)
162         throws java.lang.IndexOutOfBoundsException JavaDoc
163     {
164         //-- check bounds for index
165
if ((index < 0) || (index > _entryList.size())) {
166             throw new IndexOutOfBoundsException JavaDoc();
167         }
168         _entryList.setElementAt(vEntry, index);
169     } //-- void setEntry(int, Entry)
170

171     /**
172      *
173      * @param entryArray
174     **/

175     public void setEntry(Entry[] entryArray)
176     {
177         //-- copy array
178
_entryList.removeAllElements();
179         for (int i = 0; i < entryArray.length; i++) {
180             _entryList.addElement(entryArray[i]);
181         }
182     } //-- void setEntry(Entry)
183

184     /**
185      *
186      * @param reader
187     **/

188     public static org.apache.jetspeed.xml.api.jcm.Topics unmarshal(java.io.Reader JavaDoc reader)
189         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
190     {
191         return (org.apache.jetspeed.xml.api.jcm.Topics) Unmarshaller.unmarshal(org.apache.jetspeed.xml.api.jcm.Topics.class, reader);
192     } //-- org.apache.jetspeed.xml.api.jcm.Topics unmarshal(java.io.Reader)
193

194     /**
195     **/

196     public void validate()
197         throws org.exolab.castor.xml.ValidationException
198     {
199         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
200         validator.validate(this);
201     } //-- void validate()
202

203 }
204
Popular Tags