Clover icon

jalviewX

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

File Pdbentry.java

 

Coverage histogram

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

Code metrics

6
37
23
1
375
151
29
0.78
1.61
23
1.26

Classes

Class Line # Actions
Pdbentry 22 37 29 46
0.303030330.3%
 

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 Pdbentry.
19    *
20    * @version $Revision$ $Date$
21    */
 
22    public class Pdbentry implements java.io.Serializable
23    {
24   
25    // --------------------------/
26    // - Class/Member Variables -/
27    // --------------------------/
28   
29    /**
30    * Field _id.
31    */
32    private java.lang.String _id;
33   
34    /**
35    * Field _type.
36    */
37    private java.lang.String _type;
38   
39    /**
40    * Field _file.
41    */
42    private java.lang.String _file;
43   
44    /**
45    * Field _items.
46    */
47    private java.util.Vector _items;
48   
49    // ----------------/
50    // - Constructors -/
51    // ----------------/
52   
 
53  262 toggle public Pdbentry()
54    {
55  262 super();
56  262 this._items = new java.util.Vector();
57    }
58   
59    // -----------/
60    // - Methods -/
61    // -----------/
62   
63    /**
64    *
65    *
66    * @param vPdbentryItem
67    * @throws java.lang.IndexOutOfBoundsException
68    * if the index given is outside the bounds of the collection
69    */
 
70  84 toggle public void addPdbentryItem(
71    final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)
72    throws java.lang.IndexOutOfBoundsException
73    {
74  84 this._items.addElement(vPdbentryItem);
75    }
76   
77    /**
78    *
79    *
80    * @param index
81    * @param vPdbentryItem
82    * @throws java.lang.IndexOutOfBoundsException
83    * if the index given is outside the bounds of the collection
84    */
 
85  0 toggle public void addPdbentryItem(final int index,
86    final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)
87    throws java.lang.IndexOutOfBoundsException
88    {
89  0 this._items.add(index, vPdbentryItem);
90    }
91   
92    /**
93    * Method enumeratePdbentryItem.
94    *
95    * @return an Enumeration over all jalview.schemabinding.version2.PdbentryItem
96    * elements
97    */
 
98  0 toggle public java.util.Enumeration enumeratePdbentryItem()
99    {
100  0 return this._items.elements();
101    }
102   
103    /**
104    * Returns the value of field 'file'.
105    *
106    * @return the value of field 'File'.
107    */
 
108  720 toggle public java.lang.String getFile()
109    {
110  720 return this._file;
111    }
112   
113    /**
114    * Returns the value of field 'id'.
115    *
116    * @return the value of field 'Id'.
117    */
 
118  618 toggle public java.lang.String getId()
119    {
120  618 return this._id;
121    }
122   
123    /**
124    * Method getPdbentryItem.
125    *
126    * @param index
127    * @throws java.lang.IndexOutOfBoundsException
128    * if the index given is outside the bounds of the collection
129    * @return the value of the jalview.schemabinding.version2.PdbentryItem at the
130    * given inde
131    */
 
132  0 toggle public jalview.schemabinding.version2.PdbentryItem getPdbentryItem(
133    final int index) throws java.lang.IndexOutOfBoundsException
134    {
135    // check bounds for index
136  0 if (index < 0 || index >= this._items.size())
137    {
138  0 throw new IndexOutOfBoundsException("getPdbentryItem: Index value '"
139    + index + "' not in range [0.." + (this._items.size() - 1)
140    + "]");
141    }
142   
143  0 return (jalview.schemabinding.version2.PdbentryItem) _items.get(index);
144    }
145   
146    /**
147    * Method getPdbentryItem.Returns the contents of the collection in an Array.
148    * <p>
149    * Note: Just in case the collection contents are changing in another thread,
150    * we pass a 0-length Array of the correct type into the API call. This way we
151    * <i>know</i> that the Array returned is of exactly the correct length.
152    *
153    * @return this collection as an Array
154    */
 
155  262 toggle public jalview.schemabinding.version2.PdbentryItem[] getPdbentryItem()
156    {
157  262 jalview.schemabinding.version2.PdbentryItem[] array = new jalview.schemabinding.version2.PdbentryItem[0];
158  262 return (jalview.schemabinding.version2.PdbentryItem[]) this._items
159    .toArray(array);
160    }
161   
162    /**
163    * Method getPdbentryItemCount.
164    *
165    * @return the size of this collection
166    */
 
167  0 toggle public int getPdbentryItemCount()
168    {
169  0 return this._items.size();
170    }
171   
172    /**
173    * Returns the value of field 'type'.
174    *
175    * @return the value of field 'Type'.
176    */
 
177  248 toggle public java.lang.String getType()
178    {
179  248 return this._type;
180    }
181   
182    /**
183    * Method isValid.
184    *
185    * @return true if this object is valid according to the schema
186    */
 
187  0 toggle public boolean isValid()
188    {
189  0 try
190    {
191  0 validate();
192    } catch (org.exolab.castor.xml.ValidationException vex)
193    {
194  0 return false;
195    }
196  0 return true;
197    }
198   
199    /**
200    *
201    *
202    * @param out
203    * @throws org.exolab.castor.xml.MarshalException
204    * if object is null or if any SAXException is thrown during
205    * marshaling
206    * @throws org.exolab.castor.xml.ValidationException
207    * if this object is an invalid instance according to the schema
208    */
 
209  0 toggle public void marshal(final java.io.Writer out)
210    throws org.exolab.castor.xml.MarshalException,
211    org.exolab.castor.xml.ValidationException
212    {
213  0 Marshaller.marshal(this, out);
214    }
215   
216    /**
217    *
218    *
219    * @param handler
220    * @throws java.io.IOException
221    * if an IOException occurs during marshaling
222    * @throws org.exolab.castor.xml.ValidationException
223    * if this object is an invalid instance according to the schema
224    * @throws org.exolab.castor.xml.MarshalException
225    * if object is null or if any SAXException is thrown during
226    * marshaling
227    */
 
228  0 toggle public void marshal(final org.xml.sax.ContentHandler handler)
229    throws java.io.IOException,
230    org.exolab.castor.xml.MarshalException,
231    org.exolab.castor.xml.ValidationException
232    {
233  0 Marshaller.marshal(this, handler);
234    }
235   
236    /**
237    */
 
238  0 toggle public void removeAllPdbentryItem()
239    {
240  0 this._items.clear();
241    }
242   
243    /**
244    * Method removePdbentryItem.
245    *
246    * @param vPdbentryItem
247    * @return true if the object was removed from the collection.
248    */
 
249  0 toggle public boolean removePdbentryItem(
250    final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)
251    {
252  0 boolean removed = _items.remove(vPdbentryItem);
253  0 return removed;
254    }
255   
256    /**
257    * Method removePdbentryItemAt.
258    *
259    * @param index
260    * @return the element removed from the collection
261    */
 
262  0 toggle public jalview.schemabinding.version2.PdbentryItem removePdbentryItemAt(
263    final int index)
264    {
265  0 java.lang.Object obj = this._items.remove(index);
266  0 return (jalview.schemabinding.version2.PdbentryItem) obj;
267    }
268   
269    /**
270    * Sets the value of field 'file'.
271    *
272    * @param file
273    * the value of field 'file'.
274    */
 
275  184 toggle public void setFile(final java.lang.String file)
276    {
277  184 this._file = file;
278    }
279   
280    /**
281    * Sets the value of field 'id'.
282    *
283    * @param id
284    * the value of field 'id'.
285    */
 
286  262 toggle public void setId(final java.lang.String id)
287    {
288  262 this._id = id;
289    }
290   
291    /**
292    *
293    *
294    * @param index
295    * @param vPdbentryItem
296    * @throws java.lang.IndexOutOfBoundsException
297    * if the index given is outside the bounds of the collection
298    */
 
299  0 toggle public void setPdbentryItem(final int index,
300    final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)
301    throws java.lang.IndexOutOfBoundsException
302    {
303    // check bounds for index
304  0 if (index < 0 || index >= this._items.size())
305    {
306  0 throw new IndexOutOfBoundsException("setPdbentryItem: Index value '"
307    + index + "' not in range [0.." + (this._items.size() - 1)
308    + "]");
309    }
310   
311  0 this._items.set(index, vPdbentryItem);
312    }
313   
314    /**
315    *
316    *
317    * @param vPdbentryItemArray
318    */
 
319  0 toggle public void setPdbentryItem(
320    final jalview.schemabinding.version2.PdbentryItem[] vPdbentryItemArray)
321    {
322    // -- copy array
323  0 _items.clear();
324   
325  0 for (int i = 0; i < vPdbentryItemArray.length; i++)
326    {
327  0 this._items.add(vPdbentryItemArray[i]);
328    }
329    }
330   
331    /**
332    * Sets the value of field 'type'.
333    *
334    * @param type
335    * the value of field 'type'.
336    */
 
337  212 toggle public void setType(final java.lang.String type)
338    {
339  212 this._type = type;
340    }
341   
342    /**
343    * Method unmarshal.
344    *
345    * @param reader
346    * @throws org.exolab.castor.xml.MarshalException
347    * if object is null or if any SAXException is thrown during
348    * marshaling
349    * @throws org.exolab.castor.xml.ValidationException
350    * if this object is an invalid instance according to the schema
351    * @return the unmarshaled jalview.schemabinding.version2.Pdbentry
352    */
 
353  0 toggle public static jalview.schemabinding.version2.Pdbentry unmarshal(
354    final java.io.Reader reader)
355    throws org.exolab.castor.xml.MarshalException,
356    org.exolab.castor.xml.ValidationException
357    {
358  0 return (jalview.schemabinding.version2.Pdbentry) Unmarshaller
359    .unmarshal(jalview.schemabinding.version2.Pdbentry.class,
360    reader);
361    }
362   
363    /**
364    *
365    *
366    * @throws org.exolab.castor.xml.ValidationException
367    * if this object is an invalid instance according to the schema
368    */
 
369  0 toggle public void validate() throws org.exolab.castor.xml.ValidationException
370    {
371  0 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
372  0 validator.validate(this);
373    }
374   
375    }