1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
17 *******************************************************************************/
19 * This class was automatically generated with
20 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
25 package jalview.schemabinding.version2;
30 * @version $Revision$ $Date$
32 public class PdbentryItem implements java.io.Serializable {
35 //--------------------------/
36 //- Class/Member Variables -/
37 //--------------------------/
40 * Field _propertyList.
42 private java.util.Vector _propertyList;
49 public PdbentryItem() {
51 this._propertyList = new java.util.Vector();
63 * @throws java.lang.IndexOutOfBoundsException if the index
64 * given is outside the bounds of the collection
66 public void addProperty(
67 final jalview.schemabinding.version2.Property vProperty)
68 throws java.lang.IndexOutOfBoundsException {
69 this._propertyList.addElement(vProperty);
77 * @throws java.lang.IndexOutOfBoundsException if the index
78 * given is outside the bounds of the collection
80 public void addProperty(
82 final jalview.schemabinding.version2.Property vProperty)
83 throws java.lang.IndexOutOfBoundsException {
84 this._propertyList.add(index, vProperty);
88 * Method enumerateProperty.
90 * @return an Enumeration over all
91 * jalview.schemabinding.version2.Property elements
93 public java.util.Enumeration enumerateProperty(
95 return this._propertyList.elements();
102 * @throws java.lang.IndexOutOfBoundsException if the index
103 * given is outside the bounds of the collection
104 * @return the value of the
105 * jalview.schemabinding.version2.Property at the given index
107 public jalview.schemabinding.version2.Property getProperty(
109 throws java.lang.IndexOutOfBoundsException {
110 // check bounds for index
111 if (index < 0 || index >= this._propertyList.size()) {
112 throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
115 return (jalview.schemabinding.version2.Property) _propertyList.get(index);
119 * Method getProperty.Returns the contents of the collection in
120 * an Array. <p>Note: Just in case the collection contents
121 * are changing in another thread, we pass a 0-length Array of
122 * the correct type into the API call. This way we <i>know</i>
123 * that the Array returned is of exactly the correct length.
125 * @return this collection as an Array
127 public jalview.schemabinding.version2.Property[] getProperty(
129 jalview.schemabinding.version2.Property[] array = new jalview.schemabinding.version2.Property[0];
130 return (jalview.schemabinding.version2.Property[]) this._propertyList.toArray(array);
134 * Method getPropertyCount.
136 * @return the size of this collection
138 public int getPropertyCount(
140 return this._propertyList.size();
145 public void removeAllProperty(
147 this._propertyList.clear();
151 * Method removeProperty.
154 * @return true if the object was removed from the collection.
156 public boolean removeProperty(
157 final jalview.schemabinding.version2.Property vProperty) {
158 boolean removed = _propertyList.remove(vProperty);
163 * Method removePropertyAt.
166 * @return the element removed from the collection
168 public jalview.schemabinding.version2.Property removePropertyAt(
170 java.lang.Object obj = this._propertyList.remove(index);
171 return (jalview.schemabinding.version2.Property) obj;
179 * @throws java.lang.IndexOutOfBoundsException if the index
180 * given is outside the bounds of the collection
182 public void setProperty(
184 final jalview.schemabinding.version2.Property vProperty)
185 throws java.lang.IndexOutOfBoundsException {
186 // check bounds for index
187 if (index < 0 || index >= this._propertyList.size()) {
188 throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
191 this._propertyList.set(index, vProperty);
197 * @param vPropertyArray
199 public void setProperty(
200 final jalview.schemabinding.version2.Property[] vPropertyArray) {
202 _propertyList.clear();
204 for (int i = 0; i < vPropertyArray.length; i++) {
205 this._propertyList.add(vPropertyArray[i]);