/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
* Copyright (C) 2014 The Jalview Authors
*
* This file is part of Jalview.
*
* Jalview is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* Jalview is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Jalview. If not, see
* Note: Just in case the collection contents are changing in another thread, * we pass a 0-length Array of the correct type into the API call. This way we * know that the Array returned is of exactly the correct length. * * @return this collection as an Array */ public jalview.schemabinding.version2.MapListFrom[] getMapListFrom() { jalview.schemabinding.version2.MapListFrom[] array = new jalview.schemabinding.version2.MapListFrom[0]; return (jalview.schemabinding.version2.MapListFrom[]) this._mapListFromList .toArray(array); } /** * Method getMapListFromCount. * * @return the size of this collection */ public int getMapListFromCount() { return this._mapListFromList.size(); } /** * Method getMapListTo. * * @param index * @throws java.lang.IndexOutOfBoundsException * if the index given is outside the bounds of the collection * @return the value of the jalview.schemabinding.version2.MapListTo at the * given index */ public jalview.schemabinding.version2.MapListTo getMapListTo( final int index) throws java.lang.IndexOutOfBoundsException { // check bounds for index if (index < 0 || index >= this._mapListToList.size()) { throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ "getMapListTo", Integer.valueOf(index).toString(), Integer.valueOf((this._mapListToList.size() - 1)).toString() })); } return (jalview.schemabinding.version2.MapListTo) _mapListToList .get(index); } /** * Method getMapListTo.Returns the contents of the collection in an Array. *
* Note: Just in case the collection contents are changing in another thread, * we pass a 0-length Array of the correct type into the API call. This way we * know that the Array returned is of exactly the correct length. * * @return this collection as an Array */ public jalview.schemabinding.version2.MapListTo[] getMapListTo() { jalview.schemabinding.version2.MapListTo[] array = new jalview.schemabinding.version2.MapListTo[0]; return (jalview.schemabinding.version2.MapListTo[]) this._mapListToList .toArray(array); } /** * Method getMapListToCount. * * @return the size of this collection */ public int getMapListToCount() { return this._mapListToList.size(); } /** * Returns the value of field 'mapToUnit'. The field 'mapToUnit' has the * following description: number of dictionary symbol widths involved in each * mapped position on this sequence (for example, 3 for a dna sequence exon * region that is being mapped to a protein sequence). This is optional, since * the unit can be usually be inferred from the dictionary type of each * sequence involved in the mapping. * * @return the value of field 'MapToUnit'. */ public long getMapToUnit() { return this._mapToUnit; } /** * Method hasMapFromUnit. * * @return true if at least one MapFromUnit has been added */ public boolean hasMapFromUnit() { return this._has_mapFromUnit; } /** * Method hasMapToUnit. * * @return true if at least one MapToUnit has been added */ public boolean hasMapToUnit() { return this._has_mapToUnit; } /** * Method isValid. * * @return true if this object is valid according to the schema */ public boolean isValid() { try { validate(); } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; } /** * * * @param out * @throws org.exolab.castor.xml.MarshalException * if object is null or if any SAXException is thrown during * marshaling * @throws org.exolab.castor.xml.ValidationException * if this object is an invalid instance according to the schema */ public void marshal(final java.io.Writer out) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, out); } /** * * * @param handler * @throws java.io.IOException * if an IOException occurs during marshaling * @throws org.exolab.castor.xml.ValidationException * if this object is an invalid instance according to the schema * @throws org.exolab.castor.xml.MarshalException * if object is null or if any SAXException is thrown during * marshaling */ public void marshal(final org.xml.sax.ContentHandler handler) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, handler); } /** */ public void removeAllMapListFrom() { this._mapListFromList.clear(); } /** */ public void removeAllMapListTo() { this._mapListToList.clear(); } /** * Method removeMapListFrom. * * @param vMapListFrom * @return true if the object was removed from the collection. */ public boolean removeMapListFrom( final jalview.schemabinding.version2.MapListFrom vMapListFrom) { boolean removed = _mapListFromList.remove(vMapListFrom); return removed; } /** * Method removeMapListFromAt. * * @param index * @return the element removed from the collection */ public jalview.schemabinding.version2.MapListFrom removeMapListFromAt( final int index) { java.lang.Object obj = this._mapListFromList.remove(index); return (jalview.schemabinding.version2.MapListFrom) obj; } /** * Method removeMapListTo. * * @param vMapListTo * @return true if the object was removed from the collection. */ public boolean removeMapListTo( final jalview.schemabinding.version2.MapListTo vMapListTo) { boolean removed = _mapListToList.remove(vMapListTo); return removed; } /** * Method removeMapListToAt. * * @param index * @return the element removed from the collection */ public jalview.schemabinding.version2.MapListTo removeMapListToAt( final int index) { java.lang.Object obj = this._mapListToList.remove(index); return (jalview.schemabinding.version2.MapListTo) obj; } /** * Sets the value of field 'mapFromUnit'. The field 'mapFromUnit' has the * following description: number of dictionary symbol widths involved in each * mapped position on this sequence (for example, 3 for a dna sequence exon * region that is being mapped to a protein sequence). This is optional, since * the unit can be usually be inferred from the dictionary type of each * sequence involved in the mapping. * * @param mapFromUnit * the value of field 'mapFromUnit'. */ public void setMapFromUnit(final long mapFromUnit) { this._mapFromUnit = mapFromUnit; this._has_mapFromUnit = true; } /** * * * @param index * @param vMapListFrom * @throws java.lang.IndexOutOfBoundsException * if the index given is outside the bounds of the collection */ public void setMapListFrom(final int index, final jalview.schemabinding.version2.MapListFrom vMapListFrom) throws java.lang.IndexOutOfBoundsException { // check bounds for index if (index < 0 || index >= this._mapListFromList.size()) { throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ "setMapListFrom", Integer.valueOf(index).toString(), Integer.valueOf((this._mapListFromList.size() - 1)).toString() })); } this._mapListFromList.set(index, vMapListFrom); } /** * * * @param vMapListFromArray */ public void setMapListFrom( final jalview.schemabinding.version2.MapListFrom[] vMapListFromArray) { // -- copy array _mapListFromList.clear(); for (int i = 0; i < vMapListFromArray.length; i++) { this._mapListFromList.add(vMapListFromArray[i]); } } /** * * * @param index * @param vMapListTo * @throws java.lang.IndexOutOfBoundsException * if the index given is outside the bounds of the collection */ public void setMapListTo(final int index, final jalview.schemabinding.version2.MapListTo vMapListTo) throws java.lang.IndexOutOfBoundsException { // check bounds for index if (index < 0 || index >= this._mapListToList.size()) { throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ "setMapListTo", Integer.valueOf(index).toString(), Integer.valueOf((this._mapListToList.size() - 1)).toString() })); } this._mapListToList.set(index, vMapListTo); } /** * * * @param vMapListToArray */ public void setMapListTo( final jalview.schemabinding.version2.MapListTo[] vMapListToArray) { // -- copy array _mapListToList.clear(); for (int i = 0; i < vMapListToArray.length; i++) { this._mapListToList.add(vMapListToArray[i]); } } /** * Sets the value of field 'mapToUnit'. The field 'mapToUnit' has the * following description: number of dictionary symbol widths involved in each * mapped position on this sequence (for example, 3 for a dna sequence exon * region that is being mapped to a protein sequence). This is optional, since * the unit can be usually be inferred from the dictionary type of each * sequence involved in the mapping. * * @param mapToUnit * the value of field 'mapToUnit'. */ public void setMapToUnit(final long mapToUnit) { this._mapToUnit = mapToUnit; this._has_mapToUnit = true; } /** * Method unmarshal. * * @param reader * @throws org.exolab.castor.xml.MarshalException * if object is null or if any SAXException is thrown during * marshaling * @throws org.exolab.castor.xml.ValidationException * if this object is an invalid instance according to the schema * @return the unmarshaled jalview.schemabinding.version2.MapListType */ public static jalview.schemabinding.version2.MapListType unmarshal( final java.io.Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (jalview.schemabinding.version2.MapListType) Unmarshaller .unmarshal(jalview.schemabinding.version2.MapListType.class, reader); } /** * * * @throws org.exolab.castor.xml.ValidationException * if this object is an invalid instance according to the schema */ public void validate() throws org.exolab.castor.xml.ValidationException { org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); validator.validate(this); } }