update author list in license for (JAL-826)
[jalview.git] / src / jalview / binding / PdbentryItem.java
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
4  *
5  * This file is part of Jalview.
6  *
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.
10  *
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.
15  *
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  *******************************************************************************/
18 /*
19  * This class was automatically generated with 
20  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
21  * Schema.
22  * $Id$
23  */
24
25 package jalview.binding;
26
27 /**
28  * Class PdbentryItem.
29  * 
30  * @version $Revision$ $Date$
31  */
32 public class PdbentryItem implements java.io.Serializable {
33
34
35       //--------------------------/
36      //- Class/Member Variables -/
37     //--------------------------/
38
39     /**
40      * Field _propertyList.
41      */
42     private java.util.Vector _propertyList;
43
44
45       //----------------/
46      //- Constructors -/
47     //----------------/
48
49     public PdbentryItem() {
50         super();
51         this._propertyList = new java.util.Vector();
52     }
53
54
55       //-----------/
56      //- Methods -/
57     //-----------/
58
59     /**
60      * 
61      * 
62      * @param vProperty
63      * @throws java.lang.IndexOutOfBoundsException if the index
64      * given is outside the bounds of the collection
65      */
66     public void addProperty(
67             final jalview.binding.Property vProperty)
68     throws java.lang.IndexOutOfBoundsException {
69         this._propertyList.addElement(vProperty);
70     }
71
72     /**
73      * 
74      * 
75      * @param index
76      * @param vProperty
77      * @throws java.lang.IndexOutOfBoundsException if the index
78      * given is outside the bounds of the collection
79      */
80     public void addProperty(
81             final int index,
82             final jalview.binding.Property vProperty)
83     throws java.lang.IndexOutOfBoundsException {
84         this._propertyList.add(index, vProperty);
85     }
86
87     /**
88      * Method enumerateProperty.
89      * 
90      * @return an Enumeration over all jalview.binding.Property
91      * elements
92      */
93     public java.util.Enumeration enumerateProperty(
94     ) {
95         return this._propertyList.elements();
96     }
97
98     /**
99      * Method getProperty.
100      * 
101      * @param index
102      * @throws java.lang.IndexOutOfBoundsException if the index
103      * given is outside the bounds of the collection
104      * @return the value of the jalview.binding.Property at the
105      * given index
106      */
107     public jalview.binding.Property getProperty(
108             final int index)
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) + "]");
113         }
114         
115         return (jalview.binding.Property) _propertyList.get(index);
116     }
117
118     /**
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.
124      * 
125      * @return this collection as an Array
126      */
127     public jalview.binding.Property[] getProperty(
128     ) {
129         jalview.binding.Property[] array = new jalview.binding.Property[0];
130         return (jalview.binding.Property[]) this._propertyList.toArray(array);
131     }
132
133     /**
134      * Method getPropertyCount.
135      * 
136      * @return the size of this collection
137      */
138     public int getPropertyCount(
139     ) {
140         return this._propertyList.size();
141     }
142
143     /**
144      */
145     public void removeAllProperty(
146     ) {
147         this._propertyList.clear();
148     }
149
150     /**
151      * Method removeProperty.
152      * 
153      * @param vProperty
154      * @return true if the object was removed from the collection.
155      */
156     public boolean removeProperty(
157             final jalview.binding.Property vProperty) {
158         boolean removed = _propertyList.remove(vProperty);
159         return removed;
160     }
161
162     /**
163      * Method removePropertyAt.
164      * 
165      * @param index
166      * @return the element removed from the collection
167      */
168     public jalview.binding.Property removePropertyAt(
169             final int index) {
170         java.lang.Object obj = this._propertyList.remove(index);
171         return (jalview.binding.Property) obj;
172     }
173
174     /**
175      * 
176      * 
177      * @param index
178      * @param vProperty
179      * @throws java.lang.IndexOutOfBoundsException if the index
180      * given is outside the bounds of the collection
181      */
182     public void setProperty(
183             final int index,
184             final jalview.binding.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) + "]");
189         }
190         
191         this._propertyList.set(index, vProperty);
192     }
193
194     /**
195      * 
196      * 
197      * @param vPropertyArray
198      */
199     public void setProperty(
200             final jalview.binding.Property[] vPropertyArray) {
201         //-- copy array
202         _propertyList.clear();
203         
204         for (int i = 0; i < vPropertyArray.length; i++) {
205                 this._propertyList.add(vPropertyArray[i]);
206         }
207     }
208
209 }