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