1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $(date) The Jalview Authors
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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
20 *******************************************************************************/
22 * This class was automatically generated with
23 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
28 package jalview.schemabinding.version2;
33 * @version $Revision$ $Date$
35 public class PdbentryItem implements java.io.Serializable
38 // --------------------------/
39 // - Class/Member Variables -/
40 // --------------------------/
43 * Field _propertyList.
45 private java.util.Vector _propertyList;
54 this._propertyList = new java.util.Vector();
65 * @throws java.lang.IndexOutOfBoundsException
66 * if the index given is outside the bounds of the collection
68 public void addProperty(
69 final jalview.schemabinding.version2.Property vProperty)
70 throws java.lang.IndexOutOfBoundsException
72 this._propertyList.addElement(vProperty);
80 * @throws java.lang.IndexOutOfBoundsException
81 * if the index given is outside the bounds of the collection
83 public void addProperty(final int index,
84 final jalview.schemabinding.version2.Property vProperty)
85 throws java.lang.IndexOutOfBoundsException
87 this._propertyList.add(index, vProperty);
91 * Method enumerateProperty.
93 * @return an Enumeration over all jalview.schemabinding.version2.Property
96 public java.util.Enumeration enumerateProperty()
98 return this._propertyList.elements();
102 * Method getProperty.
105 * @throws java.lang.IndexOutOfBoundsException
106 * if the index given is outside the bounds of the collection
107 * @return the value of the jalview.schemabinding.version2.Property at the
110 public jalview.schemabinding.version2.Property getProperty(final int index)
111 throws java.lang.IndexOutOfBoundsException
113 // check bounds for index
114 if (index < 0 || index >= this._propertyList.size())
116 throw new IndexOutOfBoundsException("getProperty: Index value '"
117 + index + "' not in range [0.."
118 + (this._propertyList.size() - 1) + "]");
121 return (jalview.schemabinding.version2.Property) _propertyList
126 * Method getProperty.Returns the contents of the collection in an Array.
128 * Note: Just in case the collection contents are changing in another thread,
129 * we pass a 0-length Array of the correct type into the API call. This way we
130 * <i>know</i> that the Array returned is of exactly the correct length.
132 * @return this collection as an Array
134 public jalview.schemabinding.version2.Property[] getProperty()
136 jalview.schemabinding.version2.Property[] array = new jalview.schemabinding.version2.Property[0];
137 return (jalview.schemabinding.version2.Property[]) this._propertyList
142 * Method getPropertyCount.
144 * @return the size of this collection
146 public int getPropertyCount()
148 return this._propertyList.size();
153 public void removeAllProperty()
155 this._propertyList.clear();
159 * Method removeProperty.
162 * @return true if the object was removed from the collection.
164 public boolean removeProperty(
165 final jalview.schemabinding.version2.Property vProperty)
167 boolean removed = _propertyList.remove(vProperty);
172 * Method removePropertyAt.
175 * @return the element removed from the collection
177 public jalview.schemabinding.version2.Property removePropertyAt(
180 java.lang.Object obj = this._propertyList.remove(index);
181 return (jalview.schemabinding.version2.Property) obj;
189 * @throws java.lang.IndexOutOfBoundsException
190 * if the index given is outside the bounds of the collection
192 public void setProperty(final int index,
193 final jalview.schemabinding.version2.Property vProperty)
194 throws java.lang.IndexOutOfBoundsException
196 // check bounds for index
197 if (index < 0 || index >= this._propertyList.size())
199 throw new IndexOutOfBoundsException("setProperty: Index value '"
200 + index + "' not in range [0.."
201 + (this._propertyList.size() - 1) + "]");
204 this._propertyList.set(index, vProperty);
210 * @param vPropertyArray
212 public void setProperty(
213 final jalview.schemabinding.version2.Property[] vPropertyArray)
216 _propertyList.clear();
218 for (int i = 0; i < vPropertyArray.length; i++)
220 this._propertyList.add(vPropertyArray[i]);