1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
3 * Copyright (C) 2014 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 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.
17 * If not, see <http://www.gnu.org/licenses/>.
18 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 ******************************************************************************/
21 * This class was automatically generated with
22 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
27 package jalview.schemabinding.version2;
32 * @version $Revision$ $Date$
34 public class PdbentryItem implements java.io.Serializable
37 // --------------------------/
38 // - Class/Member Variables -/
39 // --------------------------/
42 * Field _propertyList.
44 private java.util.Vector _propertyList;
53 this._propertyList = new java.util.Vector();
64 * @throws java.lang.IndexOutOfBoundsException
65 * if the index given is outside the bounds of the collection
67 public void addProperty(
68 final jalview.schemabinding.version2.Property vProperty)
69 throws java.lang.IndexOutOfBoundsException
71 this._propertyList.addElement(vProperty);
79 * @throws java.lang.IndexOutOfBoundsException
80 * if the index given is outside the bounds of the collection
82 public void addProperty(final int index,
83 final jalview.schemabinding.version2.Property vProperty)
84 throws java.lang.IndexOutOfBoundsException
86 this._propertyList.add(index, vProperty);
90 * Method enumerateProperty.
92 * @return an Enumeration over all jalview.schemabinding.version2.Property
95 public java.util.Enumeration enumerateProperty()
97 return this._propertyList.elements();
101 * Method getProperty.
104 * @throws java.lang.IndexOutOfBoundsException
105 * if the index given is outside the bounds of the collection
106 * @return the value of the jalview.schemabinding.version2.Property at the
109 public jalview.schemabinding.version2.Property getProperty(final int index)
110 throws java.lang.IndexOutOfBoundsException
112 // check bounds for index
113 if (index < 0 || index >= this._propertyList.size())
115 throw new IndexOutOfBoundsException("getProperty: Index value '"
116 + index + "' not in range [0.."
117 + (this._propertyList.size() - 1) + "]");
120 return (jalview.schemabinding.version2.Property) _propertyList
125 * Method getProperty.Returns the contents of the collection in an Array.
127 * Note: Just in case the collection contents are changing in another thread,
128 * we pass a 0-length Array of the correct type into the API call. This way we
129 * <i>know</i> that the Array returned is of exactly the correct length.
131 * @return this collection as an Array
133 public jalview.schemabinding.version2.Property[] getProperty()
135 jalview.schemabinding.version2.Property[] array = new jalview.schemabinding.version2.Property[0];
136 return (jalview.schemabinding.version2.Property[]) this._propertyList
141 * Method getPropertyCount.
143 * @return the size of this collection
145 public int getPropertyCount()
147 return this._propertyList.size();
152 public void removeAllProperty()
154 this._propertyList.clear();
158 * Method removeProperty.
161 * @return true if the object was removed from the collection.
163 public boolean removeProperty(
164 final jalview.schemabinding.version2.Property vProperty)
166 boolean removed = _propertyList.remove(vProperty);
171 * Method removePropertyAt.
174 * @return the element removed from the collection
176 public jalview.schemabinding.version2.Property removePropertyAt(
179 java.lang.Object obj = this._propertyList.remove(index);
180 return (jalview.schemabinding.version2.Property) obj;
188 * @throws java.lang.IndexOutOfBoundsException
189 * if the index given is outside the bounds of the collection
191 public void setProperty(final int index,
192 final jalview.schemabinding.version2.Property vProperty)
193 throws java.lang.IndexOutOfBoundsException
195 // check bounds for index
196 if (index < 0 || index >= this._propertyList.size())
198 throw new IndexOutOfBoundsException("setProperty: Index value '"
199 + index + "' not in range [0.."
200 + (this._propertyList.size() - 1) + "]");
203 this._propertyList.set(index, vProperty);
209 * @param vPropertyArray
211 public void setProperty(
212 final jalview.schemabinding.version2.Property[] vPropertyArray)
215 _propertyList.clear();
217 for (int i = 0; i < vPropertyArray.length; i++)
219 this._propertyList.add(vPropertyArray[i]);