X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fschemabinding%2Fversion2%2FPdbentryItem.java;h=5554b49c9f811f96cad2fcb0c4edc93182cd9678;hb=2dcd2b8cfb1b38575c8b2246d59ba1c1a2fb59cd;hp=527f5abc783b1b619856e946c8dca949d4c72ca4;hpb=7bc226b58110fa26d9dbd3f0c78095d06909ffc3;p=jalview.git diff --git a/src/jalview/schemabinding/version2/PdbentryItem.java b/src/jalview/schemabinding/version2/PdbentryItem.java old mode 100755 new mode 100644 index 527f5ab..5554b49 --- a/src/jalview/schemabinding/version2/PdbentryItem.java +++ b/src/jalview/schemabinding/version2/PdbentryItem.java @@ -1,203 +1,204 @@ -/* - * This class was automatically generated with - * Castor 0.9.6, using an XML - * Schema. - * $Id$ - */ - -package jalview.schemabinding.version2; - -//---------------------------------/ -//- Imported classes and packages -/ -//---------------------------------/ - -import java.util.*; - -/** - * Class PdbentryItem. - * - * @version $Revision$ $Date$ - */ -public class PdbentryItem - implements java.io.Serializable -{ - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _propertyList - */ - private java.util.Vector _propertyList; - - //----------------/ - //- Constructors -/ - //----------------/ - - public PdbentryItem() - { - super(); - _propertyList = new Vector(); - } //-- jalview.schemabinding.version2.PdbentryItem() - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Method addProperty - * - * - * - * @param vProperty - */ - public void addProperty(jalview.schemabinding.version2.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - _propertyList.addElement(vProperty); - } //-- void addProperty(jalview.schemabinding.version2.Property) - - /** - * Method addProperty - * - * - * - * @param index - * @param vProperty - */ - public void addProperty(int index, - jalview.schemabinding.version2.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - _propertyList.insertElementAt(vProperty, index); - } //-- void addProperty(int, jalview.schemabinding.version2.Property) - - /** - * Method enumerateProperty - * - * - * - * @return Enumeration - */ - public java.util.Enumeration enumerateProperty() - { - return _propertyList.elements(); - } //-- java.util.Enumeration enumerateProperty() - - /** - * Method getProperty - * - * - * - * @param index - * @return Property - */ - public jalview.schemabinding.version2.Property getProperty(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ( (index < 0) || (index > _propertyList.size())) - { - throw new IndexOutOfBoundsException(); - } - - return (jalview.schemabinding.version2.Property) _propertyList.elementAt( - index); - } //-- jalview.schemabinding.version2.Property getProperty(int) - - /** - * Method getProperty - * - * - * - * @return Property - */ - public jalview.schemabinding.version2.Property[] getProperty() - { - int size = _propertyList.size(); - jalview.schemabinding.version2.Property[] mArray = new jalview. - schemabinding.version2.Property[size]; - for (int index = 0; index < size; index++) - { - mArray[index] = (jalview.schemabinding.version2.Property) _propertyList. - elementAt(index); - } - return mArray; - } //-- jalview.schemabinding.version2.Property[] getProperty() - - /** - * Method getPropertyCount - * - * - * - * @return int - */ - public int getPropertyCount() - { - return _propertyList.size(); - } //-- int getPropertyCount() - - /** - * Method removeAllProperty - * - */ - public void removeAllProperty() - { - _propertyList.removeAllElements(); - } //-- void removeAllProperty() - - /** - * Method removeProperty - * - * - * - * @param index - * @return Property - */ - public jalview.schemabinding.version2.Property removeProperty(int index) - { - java.lang.Object obj = _propertyList.elementAt(index); - _propertyList.removeElementAt(index); - return (jalview.schemabinding.version2.Property) obj; - } //-- jalview.schemabinding.version2.Property removeProperty(int) - - /** - * Method setProperty - * - * - * - * @param index - * @param vProperty - */ - public void setProperty(int index, - jalview.schemabinding.version2.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ( (index < 0) || (index > _propertyList.size())) - { - throw new IndexOutOfBoundsException(); - } - _propertyList.setElementAt(vProperty, index); - } //-- void setProperty(int, jalview.schemabinding.version2.Property) - - /** - * Method setProperty - * - * - * - * @param propertyArray - */ - public void setProperty(jalview.schemabinding.version2.Property[] - propertyArray) - { - //-- copy array - _propertyList.removeAllElements(); - for (int i = 0; i < propertyArray.length; i++) - { - _propertyList.addElement(propertyArray[i]); - } - } //-- void setProperty(jalview.schemabinding.version2.Property) - -} +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + +/** + * Class PdbentryItem. + * + * @version $Revision$ $Date$ + */ +public class PdbentryItem implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _propertyList. + */ + private java.util.Vector _propertyList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public PdbentryItem() + { + super(); + this._propertyList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vProperty + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addProperty( + final jalview.schemabinding.version2.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + this._propertyList.addElement(vProperty); + } + + /** + * + * + * @param index + * @param vProperty + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addProperty(final int index, + final jalview.schemabinding.version2.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + this._propertyList.add(index, vProperty); + } + + /** + * Method enumerateProperty. + * + * @return an Enumeration over all jalview.schemabinding.version2.Property + * elements + */ + public java.util.Enumeration enumerateProperty() + { + return this._propertyList.elements(); + } + + /** + * Method getProperty. + * + * @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.Property at the + * given index + */ + public jalview.schemabinding.version2.Property getProperty(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) + { + throw new IndexOutOfBoundsException("getProperty: Index value '" + + index + "' not in range [0.." + + (this._propertyList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.Property) _propertyList + .get(index); + } + + /** + * Method getProperty.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.Property[] getProperty() + { + jalview.schemabinding.version2.Property[] array = new jalview.schemabinding.version2.Property[0]; + return (jalview.schemabinding.version2.Property[]) this._propertyList + .toArray(array); + } + + /** + * Method getPropertyCount. + * + * @return the size of this collection + */ + public int getPropertyCount() + { + return this._propertyList.size(); + } + + /** + */ + public void removeAllProperty() + { + this._propertyList.clear(); + } + + /** + * Method removeProperty. + * + * @param vProperty + * @return true if the object was removed from the collection. + */ + public boolean removeProperty( + final jalview.schemabinding.version2.Property vProperty) + { + boolean removed = _propertyList.remove(vProperty); + return removed; + } + + /** + * Method removePropertyAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.Property removePropertyAt( + final int index) + { + java.lang.Object obj = this._propertyList.remove(index); + return (jalview.schemabinding.version2.Property) obj; + } + + /** + * + * + * @param index + * @param vProperty + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setProperty(final int index, + final jalview.schemabinding.version2.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) + { + throw new IndexOutOfBoundsException("setProperty: Index value '" + + index + "' not in range [0.." + + (this._propertyList.size() - 1) + "]"); + } + + this._propertyList.set(index, vProperty); + } + + /** + * + * + * @param vPropertyArray + */ + public void setProperty( + final jalview.schemabinding.version2.Property[] vPropertyArray) + { + // -- copy array + _propertyList.clear(); + + for (int i = 0; i < vPropertyArray.length; i++) + { + this._propertyList.add(vPropertyArray[i]); + } + } + +}