Clover icon

jalviewX

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

File Sequence.java

 

Coverage histogram

../../../img/srcFileCovDistChart4.png
45% of files have more coverage

Code metrics

6
33
19
1
328
130
25
0.76
1.74
19
1.32

Classes

Class Line # Actions
Sequence 22 33 25 40
0.3103448231%
 

Contributing tests

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