X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemabinding%2Fversion2%2FCompoundMatcher.java;fp=src%2Fjalview%2Fschemabinding%2Fversion2%2FCompoundMatcher.java;h=0000000000000000000000000000000000000000;hb=4d64932654de3f6ffe07db11d18f2d21f558c6e6;hp=27714e2a73f3f163bc99d9c80b723b8af9ee9381;hpb=382f5ff058a4c2fed1e9874bb712b40f16ec1a4e;p=jalview.git diff --git a/src/jalview/schemabinding/version2/CompoundMatcher.java b/src/jalview/schemabinding/version2/CompoundMatcher.java deleted file mode 100644 index 27714e2..0000000 --- a/src/jalview/schemabinding/version2/CompoundMatcher.java +++ /dev/null @@ -1,374 +0,0 @@ -/* - * This class was automatically generated with - * Castor 1.1, using an XML - * Schema. - * $Id$ - */ - -package jalview.schemabinding.version2; - -//---------------------------------/ -//- Imported classes and packages -/ -//---------------------------------/ - -import org.exolab.castor.xml.Marshaller; -import org.exolab.castor.xml.Unmarshaller; - -/** - * Class CompoundMatcher. - * - * @version $Revision$ $Date$ - */ -public class CompoundMatcher implements java.io.Serializable -{ - - // --------------------------/ - // - Class/Member Variables -/ - // --------------------------/ - - /** - * If true, matchers are AND-ed, if false they are OR-ed - */ - private boolean _and; - - /** - * keeps track of state for field: _and - */ - private boolean _has_and; - - /** - * Field _matcherSetList. - */ - private java.util.Vector _matcherSetList; - - // ----------------/ - // - Constructors -/ - // ----------------/ - - public CompoundMatcher() - { - super(); - this._matcherSetList = new java.util.Vector(); - } - - // -----------/ - // - Methods -/ - // -----------/ - - /** - * - * - * @param vMatcherSet - * @throws java.lang.IndexOutOfBoundsException - * if the index given is outside the bounds of the collection - */ - public void addMatcherSet( - final jalview.schemabinding.version2.MatcherSet vMatcherSet) - throws java.lang.IndexOutOfBoundsException - { - // check for the maximum size - if (this._matcherSetList.size() >= 2) - { - throw new IndexOutOfBoundsException( - "addMatcherSet has a maximum of 2"); - } - - this._matcherSetList.addElement(vMatcherSet); - } - - /** - * - * - * @param index - * @param vMatcherSet - * @throws java.lang.IndexOutOfBoundsException - * if the index given is outside the bounds of the collection - */ - public void addMatcherSet(final int index, - final jalview.schemabinding.version2.MatcherSet vMatcherSet) - throws java.lang.IndexOutOfBoundsException - { - // check for the maximum size - if (this._matcherSetList.size() >= 2) - { - throw new IndexOutOfBoundsException( - "addMatcherSet has a maximum of 2"); - } - - this._matcherSetList.add(index, vMatcherSet); - } - - /** - */ - public void deleteAnd() - { - this._has_and = false; - } - - /** - * Method enumerateMatcherSet. - * - * @return an Enumeration over all jalview.schemabinding.version2.MatcherSet - * elements - */ - public java.util.Enumeration enumerateMatcherSet() - { - return this._matcherSetList.elements(); - } - - /** - * Returns the value of field 'and'. The field 'and' has the following - * description: If true, matchers are AND-ed, if false they are OR-ed - * - * @return the value of field 'And'. - */ - public boolean getAnd() - { - return this._and; - } - - /** - * Method getMatcherSet. - * - * @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.MatcherSet at the - * given index - */ - public jalview.schemabinding.version2.MatcherSet getMatcherSet( - final int index) throws java.lang.IndexOutOfBoundsException - { - // check bounds for index - if (index < 0 || index >= this._matcherSetList.size()) - { - throw new IndexOutOfBoundsException( - "getMatcherSet: Index value '" + index + "' not in range [0.." - + (this._matcherSetList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.MatcherSet) _matcherSetList - .get(index); - } - - /** - * Method getMatcherSet.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.MatcherSet[] getMatcherSet() - { - jalview.schemabinding.version2.MatcherSet[] array = new jalview.schemabinding.version2.MatcherSet[0]; - return (jalview.schemabinding.version2.MatcherSet[]) this._matcherSetList - .toArray(array); - } - - /** - * Method getMatcherSetCount. - * - * @return the size of this collection - */ - public int getMatcherSetCount() - { - return this._matcherSetList.size(); - } - - /** - * Method hasAnd. - * - * @return true if at least one And has been added - */ - public boolean hasAnd() - { - return this._has_and; - } - - /** - * Returns the value of field 'and'. The field 'and' has the following - * description: If true, matchers are AND-ed, if false they are OR-ed - * - * @return the value of field 'And'. - */ - public boolean isAnd() - { - return this._and; - } - - /** - * 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 removeAllMatcherSet() - { - this._matcherSetList.clear(); - } - - /** - * Method removeMatcherSet. - * - * @param vMatcherSet - * @return true if the object was removed from the collection. - */ - public boolean removeMatcherSet( - final jalview.schemabinding.version2.MatcherSet vMatcherSet) - { - boolean removed = _matcherSetList.remove(vMatcherSet); - return removed; - } - - /** - * Method removeMatcherSetAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.MatcherSet removeMatcherSetAt( - final int index) - { - java.lang.Object obj = this._matcherSetList.remove(index); - return (jalview.schemabinding.version2.MatcherSet) obj; - } - - /** - * Sets the value of field 'and'. The field 'and' has the following - * description: If true, matchers are AND-ed, if false they are OR-ed - * - * @param and - * the value of field 'and'. - */ - public void setAnd(final boolean and) - { - this._and = and; - this._has_and = true; - } - - /** - * - * - * @param index - * @param vMatcherSet - * @throws java.lang.IndexOutOfBoundsException - * if the index given is outside the bounds of the collection - */ - public void setMatcherSet(final int index, - final jalview.schemabinding.version2.MatcherSet vMatcherSet) - throws java.lang.IndexOutOfBoundsException - { - // check bounds for index - if (index < 0 || index >= this._matcherSetList.size()) - { - throw new IndexOutOfBoundsException( - "setMatcherSet: Index value '" + index + "' not in range [0.." - + (this._matcherSetList.size() - 1) + "]"); - } - - this._matcherSetList.set(index, vMatcherSet); - } - - /** - * - * - * @param vMatcherSetArray - */ - public void setMatcherSet( - final jalview.schemabinding.version2.MatcherSet[] vMatcherSetArray) - { - // -- copy array - _matcherSetList.clear(); - - for (int i = 0; i < vMatcherSetArray.length; i++) - { - this._matcherSetList.add(vMatcherSetArray[i]); - } - } - - /** - * 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.CompoundMatcher - */ - public static jalview.schemabinding.version2.CompoundMatcher unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, - org.exolab.castor.xml.ValidationException - { - return (jalview.schemabinding.version2.CompoundMatcher) Unmarshaller - .unmarshal(jalview.schemabinding.version2.CompoundMatcher.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); - } - -}