Clover icon

jalviewX

  1. Project Clover database Wed Oct 31 2018 15:13:58 GMT
  2. Package jalview.schemabinding.version2

File Pdbids.java

 

Coverage histogram

../../../img/srcFileCovDistChart3.png
47% of files have more coverage

Code metrics

6
31
17
1
303
129
23
0.74
1.82
17
1.35

Classes

Class Line # Actions
Pdbids 22 31 23 40
0.2592592525.9%
 

Contributing tests

This file is covered by 8 tests. .

Source view

1    /*
2    * This class was automatically generated with
3    * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8    package jalview.schemabinding.version2;
9   
10    //---------------------------------/
11    //- Imported classes and packages -/
12    //---------------------------------/
13   
14    import org.exolab.castor.xml.Marshaller;
15    import org.exolab.castor.xml.Unmarshaller;
16   
17    /**
18    * Class Pdbids.
19    *
20    * @version $Revision$ $Date$
21    */
 
22    public class Pdbids extends jalview.schemabinding.version2.Pdbentry
23    implements java.io.Serializable
24    {
25   
26    // --------------------------/
27    // - Class/Member Variables -/
28    // --------------------------/
29   
30    /**
31    * Field _structureStateList.
32    */
33    private java.util.Vector _structureStateList;
34   
35    // ----------------/
36    // - Constructors -/
37    // ----------------/
38   
 
39  262 toggle public Pdbids()
40    {
41  262 super();
42  262 this._structureStateList = new java.util.Vector();
43    }
44   
45    // -----------/
46    // - Methods -/
47    // -----------/
48   
49    /**
50    *
51    *
52    * @param vStructureState
53    * @throws java.lang.IndexOutOfBoundsException
54    * if the index given is outside the bounds of the collection
55    */
 
56  140 toggle public void addStructureState(
57    final jalview.schemabinding.version2.StructureState vStructureState)
58    throws java.lang.IndexOutOfBoundsException
59    {
60  140 this._structureStateList.addElement(vStructureState);
61    }
62   
63    /**
64    *
65    *
66    * @param index
67    * @param vStructureState
68    * @throws java.lang.IndexOutOfBoundsException
69    * if the index given is outside the bounds of the collection
70    */
 
71  0 toggle public void addStructureState(
72    final int index,
73    final jalview.schemabinding.version2.StructureState vStructureState)
74    throws java.lang.IndexOutOfBoundsException
75    {
76  0 this._structureStateList.add(index, vStructureState);
77    }
78   
79    /**
80    * Method enumerateStructureState.
81    *
82    * @return an Enumeration over all
83    * jalview.schemabinding.version2.StructureState elements
84    */
 
85  0 toggle public java.util.Enumeration enumerateStructureState()
86    {
87  0 return this._structureStateList.elements();
88    }
89   
90    /**
91    * Method getStructureState.
92    *
93    * @param index
94    * @throws java.lang.IndexOutOfBoundsException
95    * if the index given is outside the bounds of the collection
96    * @return the value of the jalview.schemabinding.version2.StructureState at
97    * the given index
98    */
 
99  120 toggle public jalview.schemabinding.version2.StructureState getStructureState(
100    final int index) throws java.lang.IndexOutOfBoundsException
101    {
102    // check bounds for index
103  120 if (index < 0 || index >= this._structureStateList.size())
104    {
105  0 throw new IndexOutOfBoundsException(
106    "getStructureState: Index value '" + index
107    + "' not in range [0.."
108    + (this._structureStateList.size() - 1) + "]");
109    }
110   
111  120 return (jalview.schemabinding.version2.StructureState) _structureStateList
112    .get(index);
113    }
114   
115    /**
116    * Method getStructureState.Returns the contents of the collection in an
117    * Array.
118    * <p>
119    * Note: Just in case the collection contents are changing in another thread,
120    * we pass a 0-length Array of the correct type into the API call. This way we
121    * <i>know</i> that the Array returned is of exactly the correct length.
122    *
123    * @return this collection as an Array
124    */
 
125  100 toggle public jalview.schemabinding.version2.StructureState[] getStructureState()
126    {
127  100 jalview.schemabinding.version2.StructureState[] array = new jalview.schemabinding.version2.StructureState[0];
128  100 return (jalview.schemabinding.version2.StructureState[]) this._structureStateList
129    .toArray(array);
130    }
131   
132    /**
133    * Method getStructureStateCount.
134    *
135    * @return the size of this collection
136    */
 
137  187 toggle public int getStructureStateCount()
138    {
139  187 return this._structureStateList.size();
140    }
141   
142    /**
143    * Method isValid.
144    *
145    * @return true if this object is valid according to the schema
146    */
 
147  0 toggle public boolean isValid()
148    {
149  0 try
150    {
151  0 validate();
152    } catch (org.exolab.castor.xml.ValidationException vex)
153    {
154  0 return false;
155    }
156  0 return true;
157    }
158   
159    /**
160    *
161    *
162    * @param out
163    * @throws org.exolab.castor.xml.MarshalException
164    * if object is null or if any SAXException is thrown during
165    * marshaling
166    * @throws org.exolab.castor.xml.ValidationException
167    * if this object is an invalid instance according to the schema
168    */
 
169  0 toggle public void marshal(final java.io.Writer out)
170    throws org.exolab.castor.xml.MarshalException,
171    org.exolab.castor.xml.ValidationException
172    {
173  0 Marshaller.marshal(this, out);
174    }
175   
176    /**
177    *
178    *
179    * @param handler
180    * @throws java.io.IOException
181    * if an IOException occurs during marshaling
182    * @throws org.exolab.castor.xml.ValidationException
183    * if this object is an invalid instance according to the schema
184    * @throws org.exolab.castor.xml.MarshalException
185    * if object is null or if any SAXException is thrown during
186    * marshaling
187    */
 
188  0 toggle public void marshal(final org.xml.sax.ContentHandler handler)
189    throws java.io.IOException,
190    org.exolab.castor.xml.MarshalException,
191    org.exolab.castor.xml.ValidationException
192    {
193  0 Marshaller.marshal(this, handler);
194    }
195   
196    /**
197    */
 
198  0 toggle public void removeAllStructureState()
199    {
200  0 this._structureStateList.clear();
201    }
202   
203    /**
204    * Method removeStructureState.
205    *
206    * @param vStructureState
207    * @return true if the object was removed from the collection.
208    */
 
209  0 toggle public boolean removeStructureState(
210    final jalview.schemabinding.version2.StructureState vStructureState)
211    {
212  0 boolean removed = _structureStateList.remove(vStructureState);
213  0 return removed;
214    }
215   
216    /**
217    * Method removeStructureStateAt.
218    *
219    * @param index
220    * @return the element removed from the collection
221    */
 
222  0 toggle public jalview.schemabinding.version2.StructureState removeStructureStateAt(
223    final int index)
224    {
225  0 java.lang.Object obj = this._structureStateList.remove(index);
226  0 return (jalview.schemabinding.version2.StructureState) obj;
227    }
228   
229    /**
230    *
231    *
232    * @param index
233    * @param vStructureState
234    * @throws java.lang.IndexOutOfBoundsException
235    * if the index given is outside the bounds of the collection
236    */
 
237  0 toggle public void setStructureState(
238    final int index,
239    final jalview.schemabinding.version2.StructureState vStructureState)
240    throws java.lang.IndexOutOfBoundsException
241    {
242    // check bounds for index
243  0 if (index < 0 || index >= this._structureStateList.size())
244    {
245  0 throw new IndexOutOfBoundsException(
246    "setStructureState: Index value '" + index
247    + "' not in range [0.."
248    + (this._structureStateList.size() - 1) + "]");
249    }
250   
251  0 this._structureStateList.set(index, vStructureState);
252    }
253   
254    /**
255    *
256    *
257    * @param vStructureStateArray
258    */
 
259  0 toggle public void setStructureState(
260    final jalview.schemabinding.version2.StructureState[] vStructureStateArray)
261    {
262    // -- copy array
263  0 _structureStateList.clear();
264   
265  0 for (int i = 0; i < vStructureStateArray.length; i++)
266    {
267  0 this._structureStateList.add(vStructureStateArray[i]);
268    }
269    }
270   
271    /**
272    * Method unmarshal.
273    *
274    * @param reader
275    * @throws org.exolab.castor.xml.MarshalException
276    * if object is null or if any SAXException is thrown during
277    * marshaling
278    * @throws org.exolab.castor.xml.ValidationException
279    * if this object is an invalid instance according to the schema
280    * @return the unmarshaled jalview.schemabinding.version2.Pdbentry
281    */
 
282  0 toggle public static jalview.schemabinding.version2.Pdbentry unmarshal(
283    final java.io.Reader reader)
284    throws org.exolab.castor.xml.MarshalException,
285    org.exolab.castor.xml.ValidationException
286    {
287  0 return (jalview.schemabinding.version2.Pdbentry) Unmarshaller
288    .unmarshal(jalview.schemabinding.version2.Pdbids.class, reader);
289    }
290   
291    /**
292    *
293    *
294    * @throws org.exolab.castor.xml.ValidationException
295    * if this object is an invalid instance according to the schema
296    */
 
297  0 toggle public void validate() throws org.exolab.castor.xml.ValidationException
298    {
299  0 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
300  0 validator.validate(this);
301    }
302   
303    }