2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
\r
8 package jalview.schemabinding.version2;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\r
14 import org.exolab.castor.xml.Marshaller;
\r
15 import org.exolab.castor.xml.Unmarshaller;
\r
18 * developed after mapRangeType from
\r
19 * http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes
\r
21 * This effectively represents a java.util.MapList object
\r
24 * @version $Revision$ $Date$
\r
26 public class MapListType implements java.io.Serializable {
\r
29 //--------------------------/
\r
30 //- Class/Member Variables -/
\r
31 //--------------------------/
\r
34 * number of dictionary symbol widths involved in each
\r
35 * mapped position on this sequence (for example, 3 for a dna
\r
37 * region that is being mapped to a protein sequence). This is
\r
39 * since the unit can be usually be inferred from the
\r
40 * dictionary type of
\r
41 * each sequence involved in the mapping.
\r
43 private long _mapFromUnit;
\r
46 * keeps track of state for field: _mapFromUnit
\r
48 private boolean _has_mapFromUnit;
\r
51 * number of dictionary symbol widths involved in each
\r
52 * mapped position on this sequence (for example, 3 for a dna
\r
54 * region that is being mapped to a protein sequence). This is
\r
56 * since the unit can be usually be inferred from the
\r
57 * dictionary type of
\r
58 * each sequence involved in the mapping.
\r
60 private long _mapToUnit;
\r
63 * keeps track of state for field: _mapToUnit
\r
65 private boolean _has_mapToUnit;
\r
68 * a region from start to end inclusive
\r
70 private java.util.Vector _mapListFromList;
\r
73 * a region from start to end inclusive
\r
75 private java.util.Vector _mapListToList;
\r
82 public MapListType() {
\r
84 this._mapListFromList = new java.util.Vector();
\r
85 this._mapListToList = new java.util.Vector();
\r
96 * @param vMapListFrom
\r
97 * @throws java.lang.IndexOutOfBoundsException if the index
\r
98 * given is outside the bounds of the collection
\r
100 public void addMapListFrom(
\r
101 final jalview.schemabinding.version2.MapListFrom vMapListFrom)
\r
102 throws java.lang.IndexOutOfBoundsException {
\r
103 this._mapListFromList.addElement(vMapListFrom);
\r
110 * @param vMapListFrom
\r
111 * @throws java.lang.IndexOutOfBoundsException if the index
\r
112 * given is outside the bounds of the collection
\r
114 public void addMapListFrom(
\r
116 final jalview.schemabinding.version2.MapListFrom vMapListFrom)
\r
117 throws java.lang.IndexOutOfBoundsException {
\r
118 this._mapListFromList.add(index, vMapListFrom);
\r
124 * @param vMapListTo
\r
125 * @throws java.lang.IndexOutOfBoundsException if the index
\r
126 * given is outside the bounds of the collection
\r
128 public void addMapListTo(
\r
129 final jalview.schemabinding.version2.MapListTo vMapListTo)
\r
130 throws java.lang.IndexOutOfBoundsException {
\r
131 this._mapListToList.addElement(vMapListTo);
\r
138 * @param vMapListTo
\r
139 * @throws java.lang.IndexOutOfBoundsException if the index
\r
140 * given is outside the bounds of the collection
\r
142 public void addMapListTo(
\r
144 final jalview.schemabinding.version2.MapListTo vMapListTo)
\r
145 throws java.lang.IndexOutOfBoundsException {
\r
146 this._mapListToList.add(index, vMapListTo);
\r
151 public void deleteMapFromUnit(
\r
153 this._has_mapFromUnit= false;
\r
158 public void deleteMapToUnit(
\r
160 this._has_mapToUnit= false;
\r
164 * Method enumerateMapListFrom.
\r
166 * @return an Enumeration over all
\r
167 * jalview.schemabinding.version2.MapListFrom elements
\r
169 public java.util.Enumeration enumerateMapListFrom(
\r
171 return this._mapListFromList.elements();
\r
175 * Method enumerateMapListTo.
\r
177 * @return an Enumeration over all
\r
178 * jalview.schemabinding.version2.MapListTo elements
\r
180 public java.util.Enumeration enumerateMapListTo(
\r
182 return this._mapListToList.elements();
\r
186 * Returns the value of field 'mapFromUnit'. The field
\r
187 * 'mapFromUnit' has the following description: number of
\r
188 * dictionary symbol widths involved in each
\r
189 * mapped position on this sequence (for example, 3 for a dna
\r
191 * region that is being mapped to a protein sequence). This is
\r
193 * since the unit can be usually be inferred from the
\r
194 * dictionary type of
\r
195 * each sequence involved in the mapping.
\r
197 * @return the value of field 'MapFromUnit'.
\r
199 public long getMapFromUnit(
\r
201 return this._mapFromUnit;
\r
205 * Method getMapListFrom.
\r
208 * @throws java.lang.IndexOutOfBoundsException if the index
\r
209 * given is outside the bounds of the collection
\r
210 * @return the value of the
\r
211 * jalview.schemabinding.version2.MapListFrom at the given index
\r
213 public jalview.schemabinding.version2.MapListFrom getMapListFrom(
\r
215 throws java.lang.IndexOutOfBoundsException {
\r
216 // check bounds for index
\r
217 if (index < 0 || index >= this._mapListFromList.size()) {
\r
218 throw new IndexOutOfBoundsException("getMapListFrom: Index value '" + index + "' not in range [0.." + (this._mapListFromList.size() - 1) + "]");
\r
221 return (jalview.schemabinding.version2.MapListFrom) _mapListFromList.get(index);
\r
225 * Method getMapListFrom.Returns the contents of the collection
\r
226 * in an Array. <p>Note: Just in case the collection contents
\r
227 * are changing in another thread, we pass a 0-length Array of
\r
228 * the correct type into the API call. This way we <i>know</i>
\r
229 * that the Array returned is of exactly the correct length.
\r
231 * @return this collection as an Array
\r
233 public jalview.schemabinding.version2.MapListFrom[] getMapListFrom(
\r
235 jalview.schemabinding.version2.MapListFrom[] array = new jalview.schemabinding.version2.MapListFrom[0];
\r
236 return (jalview.schemabinding.version2.MapListFrom[]) this._mapListFromList.toArray(array);
\r
240 * Method getMapListFromCount.
\r
242 * @return the size of this collection
\r
244 public int getMapListFromCount(
\r
246 return this._mapListFromList.size();
\r
250 * Method getMapListTo.
\r
253 * @throws java.lang.IndexOutOfBoundsException if the index
\r
254 * given is outside the bounds of the collection
\r
255 * @return the value of the
\r
256 * jalview.schemabinding.version2.MapListTo at the given index
\r
258 public jalview.schemabinding.version2.MapListTo getMapListTo(
\r
260 throws java.lang.IndexOutOfBoundsException {
\r
261 // check bounds for index
\r
262 if (index < 0 || index >= this._mapListToList.size()) {
\r
263 throw new IndexOutOfBoundsException("getMapListTo: Index value '" + index + "' not in range [0.." + (this._mapListToList.size() - 1) + "]");
\r
266 return (jalview.schemabinding.version2.MapListTo) _mapListToList.get(index);
\r
270 * Method getMapListTo.Returns the contents of the collection
\r
271 * in an Array. <p>Note: Just in case the collection contents
\r
272 * are changing in another thread, we pass a 0-length Array of
\r
273 * the correct type into the API call. This way we <i>know</i>
\r
274 * that the Array returned is of exactly the correct length.
\r
276 * @return this collection as an Array
\r
278 public jalview.schemabinding.version2.MapListTo[] getMapListTo(
\r
280 jalview.schemabinding.version2.MapListTo[] array = new jalview.schemabinding.version2.MapListTo[0];
\r
281 return (jalview.schemabinding.version2.MapListTo[]) this._mapListToList.toArray(array);
\r
285 * Method getMapListToCount.
\r
287 * @return the size of this collection
\r
289 public int getMapListToCount(
\r
291 return this._mapListToList.size();
\r
295 * Returns the value of field 'mapToUnit'. The field
\r
296 * 'mapToUnit' has the following description: number of
\r
297 * dictionary symbol widths involved in each
\r
298 * mapped position on this sequence (for example, 3 for a dna
\r
300 * region that is being mapped to a protein sequence). This is
\r
302 * since the unit can be usually be inferred from the
\r
303 * dictionary type of
\r
304 * each sequence involved in the mapping.
\r
306 * @return the value of field 'MapToUnit'.
\r
308 public long getMapToUnit(
\r
310 return this._mapToUnit;
\r
314 * Method hasMapFromUnit.
\r
316 * @return true if at least one MapFromUnit has been added
\r
318 public boolean hasMapFromUnit(
\r
320 return this._has_mapFromUnit;
\r
324 * Method hasMapToUnit.
\r
326 * @return true if at least one MapToUnit has been added
\r
328 public boolean hasMapToUnit(
\r
330 return this._has_mapToUnit;
\r
336 * @return true if this object is valid according to the schema
\r
338 public boolean isValid(
\r
342 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
352 * @throws org.exolab.castor.xml.MarshalException if object is
\r
353 * null or if any SAXException is thrown during marshaling
\r
354 * @throws org.exolab.castor.xml.ValidationException if this
\r
355 * object is an invalid instance according to the schema
\r
357 public void marshal(
\r
358 final java.io.Writer out)
\r
359 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
360 Marshaller.marshal(this, out);
\r
367 * @throws java.io.IOException if an IOException occurs during
\r
369 * @throws org.exolab.castor.xml.ValidationException if this
\r
370 * object is an invalid instance according to the schema
\r
371 * @throws org.exolab.castor.xml.MarshalException if object is
\r
372 * null or if any SAXException is thrown during marshaling
\r
374 public void marshal(
\r
375 final org.xml.sax.ContentHandler handler)
\r
376 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
377 Marshaller.marshal(this, handler);
\r
382 public void removeAllMapListFrom(
\r
384 this._mapListFromList.clear();
\r
389 public void removeAllMapListTo(
\r
391 this._mapListToList.clear();
\r
395 * Method removeMapListFrom.
\r
397 * @param vMapListFrom
\r
398 * @return true if the object was removed from the collection.
\r
400 public boolean removeMapListFrom(
\r
401 final jalview.schemabinding.version2.MapListFrom vMapListFrom) {
\r
402 boolean removed = _mapListFromList.remove(vMapListFrom);
\r
407 * Method removeMapListFromAt.
\r
410 * @return the element removed from the collection
\r
412 public jalview.schemabinding.version2.MapListFrom removeMapListFromAt(
\r
414 java.lang.Object obj = this._mapListFromList.remove(index);
\r
415 return (jalview.schemabinding.version2.MapListFrom) obj;
\r
419 * Method removeMapListTo.
\r
421 * @param vMapListTo
\r
422 * @return true if the object was removed from the collection.
\r
424 public boolean removeMapListTo(
\r
425 final jalview.schemabinding.version2.MapListTo vMapListTo) {
\r
426 boolean removed = _mapListToList.remove(vMapListTo);
\r
431 * Method removeMapListToAt.
\r
434 * @return the element removed from the collection
\r
436 public jalview.schemabinding.version2.MapListTo removeMapListToAt(
\r
438 java.lang.Object obj = this._mapListToList.remove(index);
\r
439 return (jalview.schemabinding.version2.MapListTo) obj;
\r
443 * Sets the value of field 'mapFromUnit'. The field
\r
444 * 'mapFromUnit' has the following description: number of
\r
445 * dictionary symbol widths involved in each
\r
446 * mapped position on this sequence (for example, 3 for a dna
\r
448 * region that is being mapped to a protein sequence). This is
\r
450 * since the unit can be usually be inferred from the
\r
451 * dictionary type of
\r
452 * each sequence involved in the mapping.
\r
454 * @param mapFromUnit the value of field 'mapFromUnit'.
\r
456 public void setMapFromUnit(
\r
457 final long mapFromUnit) {
\r
458 this._mapFromUnit = mapFromUnit;
\r
459 this._has_mapFromUnit = true;
\r
466 * @param vMapListFrom
\r
467 * @throws java.lang.IndexOutOfBoundsException if the index
\r
468 * given is outside the bounds of the collection
\r
470 public void setMapListFrom(
\r
472 final jalview.schemabinding.version2.MapListFrom vMapListFrom)
\r
473 throws java.lang.IndexOutOfBoundsException {
\r
474 // check bounds for index
\r
475 if (index < 0 || index >= this._mapListFromList.size()) {
\r
476 throw new IndexOutOfBoundsException("setMapListFrom: Index value '" + index + "' not in range [0.." + (this._mapListFromList.size() - 1) + "]");
\r
479 this._mapListFromList.set(index, vMapListFrom);
\r
485 * @param vMapListFromArray
\r
487 public void setMapListFrom(
\r
488 final jalview.schemabinding.version2.MapListFrom[] vMapListFromArray) {
\r
490 _mapListFromList.clear();
\r
492 for (int i = 0; i < vMapListFromArray.length; i++) {
\r
493 this._mapListFromList.add(vMapListFromArray[i]);
\r
501 * @param vMapListTo
\r
502 * @throws java.lang.IndexOutOfBoundsException if the index
\r
503 * given is outside the bounds of the collection
\r
505 public void setMapListTo(
\r
507 final jalview.schemabinding.version2.MapListTo vMapListTo)
\r
508 throws java.lang.IndexOutOfBoundsException {
\r
509 // check bounds for index
\r
510 if (index < 0 || index >= this._mapListToList.size()) {
\r
511 throw new IndexOutOfBoundsException("setMapListTo: Index value '" + index + "' not in range [0.." + (this._mapListToList.size() - 1) + "]");
\r
514 this._mapListToList.set(index, vMapListTo);
\r
520 * @param vMapListToArray
\r
522 public void setMapListTo(
\r
523 final jalview.schemabinding.version2.MapListTo[] vMapListToArray) {
\r
525 _mapListToList.clear();
\r
527 for (int i = 0; i < vMapListToArray.length; i++) {
\r
528 this._mapListToList.add(vMapListToArray[i]);
\r
533 * Sets the value of field 'mapToUnit'. The field 'mapToUnit'
\r
534 * has the following description: number of dictionary symbol
\r
535 * widths involved in each
\r
536 * mapped position on this sequence (for example, 3 for a dna
\r
538 * region that is being mapped to a protein sequence). This is
\r
540 * since the unit can be usually be inferred from the
\r
541 * dictionary type of
\r
542 * each sequence involved in the mapping.
\r
544 * @param mapToUnit the value of field 'mapToUnit'.
\r
546 public void setMapToUnit(
\r
547 final long mapToUnit) {
\r
548 this._mapToUnit = mapToUnit;
\r
549 this._has_mapToUnit = true;
\r
553 * Method unmarshal.
\r
556 * @throws org.exolab.castor.xml.MarshalException if object is
\r
557 * null or if any SAXException is thrown during marshaling
\r
558 * @throws org.exolab.castor.xml.ValidationException if this
\r
559 * object is an invalid instance according to the schema
\r
560 * @return the unmarshaled
\r
561 * jalview.schemabinding.version2.MapListType
\r
563 public static jalview.schemabinding.version2.MapListType unmarshal(
\r
564 final java.io.Reader reader)
\r
565 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
566 return (jalview.schemabinding.version2.MapListType) Unmarshaller.unmarshal(jalview.schemabinding.version2.MapListType.class, reader);
\r
572 * @throws org.exolab.castor.xml.ValidationException if this
\r
573 * object is an invalid instance according to the schema
\r
575 public void validate(
\r
577 throws org.exolab.castor.xml.ValidationException {
\r
578 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
579 validator.validate(this);
\r