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