129bcc73ff14803514f667ce898569387a578421
[jalview.git] / src / jalview / schemabinding / version2 / PdbentryItem.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package jalview.schemabinding.version2;
9
10 /**
11  * Class PdbentryItem.
12  * 
13  * @version $Revision$ $Date$
14  */
15 public class PdbentryItem implements java.io.Serializable {
16
17
18       //--------------------------/
19      //- Class/Member Variables -/
20     //--------------------------/
21
22     /**
23      * Field _propertyList.
24      */
25     private java.util.Vector _propertyList;
26
27
28       //----------------/
29      //- Constructors -/
30     //----------------/
31
32     public PdbentryItem() {
33         super();
34         this._propertyList = new java.util.Vector();
35     }
36
37
38       //-----------/
39      //- Methods -/
40     //-----------/
41
42     /**
43      * 
44      * 
45      * @param vProperty
46      * @throws java.lang.IndexOutOfBoundsException if the index
47      * given is outside the bounds of the collection
48      */
49     public void addProperty(
50             final jalview.schemabinding.version2.Property vProperty)
51     throws java.lang.IndexOutOfBoundsException {
52         this._propertyList.addElement(vProperty);
53     }
54
55     /**
56      * 
57      * 
58      * @param index
59      * @param vProperty
60      * @throws java.lang.IndexOutOfBoundsException if the index
61      * given is outside the bounds of the collection
62      */
63     public void addProperty(
64             final int index,
65             final jalview.schemabinding.version2.Property vProperty)
66     throws java.lang.IndexOutOfBoundsException {
67         this._propertyList.add(index, vProperty);
68     }
69
70     /**
71      * Method enumerateProperty.
72      * 
73      * @return an Enumeration over all
74      * jalview.schemabinding.version2.Property elements
75      */
76     public java.util.Enumeration enumerateProperty(
77     ) {
78         return this._propertyList.elements();
79     }
80
81     /**
82      * Method getProperty.
83      * 
84      * @param index
85      * @throws java.lang.IndexOutOfBoundsException if the index
86      * given is outside the bounds of the collection
87      * @return the value of the
88      * jalview.schemabinding.version2.Property at the given index
89      */
90     public jalview.schemabinding.version2.Property getProperty(
91             final int index)
92     throws java.lang.IndexOutOfBoundsException {
93         // check bounds for index
94         if (index < 0 || index >= this._propertyList.size()) {
95             throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
96         }
97         
98         return (jalview.schemabinding.version2.Property) _propertyList.get(index);
99     }
100
101     /**
102      * Method getProperty.Returns the contents of the collection in
103      * an Array.  <p>Note:  Just in case the collection contents
104      * are changing in another thread, we pass a 0-length Array of
105      * the correct type into the API call.  This way we <i>know</i>
106      * that the Array returned is of exactly the correct length.
107      * 
108      * @return this collection as an Array
109      */
110     public jalview.schemabinding.version2.Property[] getProperty(
111     ) {
112         jalview.schemabinding.version2.Property[] array = new jalview.schemabinding.version2.Property[0];
113         return (jalview.schemabinding.version2.Property[]) this._propertyList.toArray(array);
114     }
115
116     /**
117      * Method getPropertyCount.
118      * 
119      * @return the size of this collection
120      */
121     public int getPropertyCount(
122     ) {
123         return this._propertyList.size();
124     }
125
126     /**
127      */
128     public void removeAllProperty(
129     ) {
130         this._propertyList.clear();
131     }
132
133     /**
134      * Method removeProperty.
135      * 
136      * @param vProperty
137      * @return true if the object was removed from the collection.
138      */
139     public boolean removeProperty(
140             final jalview.schemabinding.version2.Property vProperty) {
141         boolean removed = _propertyList.remove(vProperty);
142         return removed;
143     }
144
145     /**
146      * Method removePropertyAt.
147      * 
148      * @param index
149      * @return the element removed from the collection
150      */
151     public jalview.schemabinding.version2.Property removePropertyAt(
152             final int index) {
153         java.lang.Object obj = this._propertyList.remove(index);
154         return (jalview.schemabinding.version2.Property) obj;
155     }
156
157     /**
158      * 
159      * 
160      * @param index
161      * @param vProperty
162      * @throws java.lang.IndexOutOfBoundsException if the index
163      * given is outside the bounds of the collection
164      */
165     public void setProperty(
166             final int index,
167             final jalview.schemabinding.version2.Property vProperty)
168     throws java.lang.IndexOutOfBoundsException {
169         // check bounds for index
170         if (index < 0 || index >= this._propertyList.size()) {
171             throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
172         }
173         
174         this._propertyList.set(index, vProperty);
175     }
176
177     /**
178      * 
179      * 
180      * @param vPropertyArray
181      */
182     public void setProperty(
183             final jalview.schemabinding.version2.Property[] vPropertyArray) {
184         //-- copy array
185         _propertyList.clear();
186         
187         for (int i = 0; i < vPropertyArray.length; i++) {
188                 this._propertyList.add(vPropertyArray[i]);
189         }
190     }
191
192 }