import java.io.Reader;
import java.io.Serializable;
import java.io.Writer;
+import java.util.Enumeration;
+import java.util.Vector;
import org.exolab.castor.xml.MarshalException;
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;
//--------------------------/
/**
- * Field _position
+ * position with respect to the coordinate frame
+ * defined by a rangeType specification
+ *
*/
private int _position;
private boolean _has_position;
/**
- * Field _id
+ * true means the annotation element appears
+ * between the specified position and the next
+ *
*/
- private java.lang.String _id;
+ private boolean _after = false;
/**
- * Field _displayCharacter
+ * keeps track of state for field: _after
*/
- private java.lang.String _displayCharacter;
+ private boolean _has_after;
/**
- * Field _description
+ * Primary Key for vamsas object referencing
+ *
*/
- private java.lang.String _description;
+ private java.lang.String _id;
/**
- * Field _secondaryStructure
+ * Free text at this position
+ *
*/
- private java.lang.String _secondaryStructure;
+ private java.lang.String _description;
/**
- * Field _value
+ * Discrete symbol - possibly graphically
+ * represented
+ *
*/
- private float _value;
+ private java.util.Vector _glyphList;
/**
- * keeps track of state for field: _value
+ * Ordered set of float values - an application
+ * may treat the values together as a vector
+ * with common support for a set of annotation
+ * elements - but this is, again, not validated
+ * so applications should deal gracefully with
+ * varying numbers of dimensions
+ *
*/
- private boolean _has_value;
+ private java.util.Vector _valueList;
//----------------/
public AnnotationElement()
{
super();
+ _glyphList = new Vector();
+ _valueList = new Vector();
} //-- org.vamsas.objects.core.AnnotationElement()
//-----------/
/**
+ * Method addGlyph
+ *
+ *
+ *
+ * @param vGlyph
+ */
+ public void addGlyph(org.vamsas.objects.core.Glyph vGlyph)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ _glyphList.addElement(vGlyph);
+ } //-- void addGlyph(org.vamsas.objects.core.Glyph)
+
+ /**
+ * Method addGlyph
+ *
+ *
+ *
+ * @param index
+ * @param vGlyph
+ */
+ public void addGlyph(int index, org.vamsas.objects.core.Glyph vGlyph)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ _glyphList.insertElementAt(vGlyph, index);
+ } //-- void addGlyph(int, org.vamsas.objects.core.Glyph)
+
+ /**
+ * Method addValue
+ *
+ *
+ *
+ * @param vValue
+ */
+ public void addValue(float vValue)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ _valueList.addElement(new java.lang.Float(vValue));
+ } //-- void addValue(float)
+
+ /**
+ * Method addValue
+ *
+ *
+ *
+ * @param index
+ * @param vValue
+ */
+ public void addValue(int index, float vValue)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ _valueList.insertElementAt(new java.lang.Float(vValue), index);
+ } //-- void addValue(int, float)
+
+ /**
+ * Method deleteAfter
+ *
+ */
+ public void deleteAfter()
+ {
+ this._has_after= false;
+ } //-- void deleteAfter()
+
+ /**
* Method deletePosition
*
*/
} //-- void deletePosition()
/**
- * Method deleteValue
+ * Method enumerateGlyph
+ *
+ *
*
+ * @return Enumeration
*/
- public void deleteValue()
+ public java.util.Enumeration enumerateGlyph()
{
- this._has_value= false;
- } //-- void deleteValue()
+ return _glyphList.elements();
+ } //-- java.util.Enumeration enumerateGlyph()
+
+ /**
+ * Method enumerateValue
+ *
+ *
+ *
+ * @return Enumeration
+ */
+ public java.util.Enumeration enumerateValue()
+ {
+ return _valueList.elements();
+ } //-- java.util.Enumeration enumerateValue()
/**
* Note: hashCode() has not been overriden
return false;
if (this._has_position != temp._has_position)
return false;
+ if (this._after != temp._after)
+ return false;
+ if (this._has_after != temp._has_after)
+ return false;
if (this._id != null) {
if (temp._id == null) return false;
else if (!(this._id.equals(temp._id)))
}
else if (temp._id != null)
return false;
- if (this._displayCharacter != null) {
- if (temp._displayCharacter == null) return false;
- else if (!(this._displayCharacter.equals(temp._displayCharacter)))
- return false;
- }
- else if (temp._displayCharacter != null)
- return false;
if (this._description != null) {
if (temp._description == null) return false;
else if (!(this._description.equals(temp._description)))
}
else if (temp._description != null)
return false;
- if (this._secondaryStructure != null) {
- if (temp._secondaryStructure == null) return false;
- else if (!(this._secondaryStructure.equals(temp._secondaryStructure)))
+ if (this._glyphList != null) {
+ if (temp._glyphList == null) return false;
+ else if (!(this._glyphList.equals(temp._glyphList)))
return false;
}
- else if (temp._secondaryStructure != null)
- return false;
- if (this._value != temp._value)
+ else if (temp._glyphList != null)
return false;
- if (this._has_value != temp._has_value)
+ if (this._valueList != null) {
+ if (temp._valueList == null) return false;
+ else if (!(this._valueList.equals(temp._valueList)))
+ return false;
+ }
+ else if (temp._valueList != null)
return false;
return true;
}
} //-- boolean equals(java.lang.Object)
/**
- * Returns the value of field 'description'.
+ * Returns the value of field 'after'. The field 'after' has
+ * the following description: true means the annotation element
+ * appears
+ * between the specified position and the next
+ *
+ *
+ * @return boolean
+ * @return the value of field 'after'.
+ */
+ public boolean getAfter()
+ {
+ return this._after;
+ } //-- boolean getAfter()
+
+ /**
+ * Returns the value of field 'description'. The field
+ * 'description' has the following description: Free text at
+ * this position
+ *
*
* @return String
* @return the value of field 'description'.
} //-- java.lang.String getDescription()
/**
- * Returns the value of field 'displayCharacter'.
+ * Method getGlyph
*
- * @return String
- * @return the value of field 'displayCharacter'.
+ *
+ *
+ * @param index
+ * @return Glyph
*/
- public java.lang.String getDisplayCharacter()
+ public org.vamsas.objects.core.Glyph getGlyph(int index)
+ throws java.lang.IndexOutOfBoundsException
{
- return this._displayCharacter;
- } //-- java.lang.String getDisplayCharacter()
+ //-- check bounds for index
+ if ((index < 0) || (index > _glyphList.size())) {
+ throw new IndexOutOfBoundsException("getGlyph: Index value '"+index+"' not in range [0.."+_glyphList.size()+ "]");
+ }
+
+ return (org.vamsas.objects.core.Glyph) _glyphList.elementAt(index);
+ } //-- org.vamsas.objects.core.Glyph getGlyph(int)
/**
- * Returns the value of field 'id'.
+ * Method getGlyph
+ *
+ *
+ *
+ * @return Glyph
+ */
+ public org.vamsas.objects.core.Glyph[] getGlyph()
+ {
+ int size = _glyphList.size();
+ org.vamsas.objects.core.Glyph[] mArray = new org.vamsas.objects.core.Glyph[size];
+ for (int index = 0; index < size; index++) {
+ mArray[index] = (org.vamsas.objects.core.Glyph) _glyphList.elementAt(index);
+ }
+ return mArray;
+ } //-- org.vamsas.objects.core.Glyph[] getGlyph()
+
+ /**
+ * Method getGlyphCount
+ *
+ *
+ *
+ * @return int
+ */
+ public int getGlyphCount()
+ {
+ return _glyphList.size();
+ } //-- int getGlyphCount()
+
+ /**
+ * Returns the value of field 'id'. The field 'id' has the
+ * following description: Primary Key for vamsas object
+ * referencing
+ *
*
* @return String
* @return the value of field 'id'.
} //-- java.lang.String getId()
/**
- * Returns the value of field 'position'.
+ * Returns the value of field 'position'. The field 'position'
+ * has the following description: position with respect to the
+ * coordinate frame
+ * defined by a rangeType specification
+ *
*
* @return int
* @return the value of field 'position'.
} //-- int getPosition()
/**
- * Returns the value of field 'secondaryStructure'.
+ * Method getValue
*
- * @return String
- * @return the value of field 'secondaryStructure'.
+ *
+ *
+ * @param index
+ * @return float
*/
- public java.lang.String getSecondaryStructure()
+ public float getValue(int index)
+ throws java.lang.IndexOutOfBoundsException
{
- return this._secondaryStructure;
- } //-- java.lang.String getSecondaryStructure()
+ //-- check bounds for index
+ if ((index < 0) || (index > _valueList.size())) {
+ throw new IndexOutOfBoundsException("getValue: Index value '"+index+"' not in range [0.."+_valueList.size()+ "]");
+ }
+
+ return ((java.lang.Float)_valueList.elementAt(index)).floatValue();
+ } //-- float getValue(int)
/**
- * Returns the value of field 'value'.
+ * Method getValue
+ *
+ *
*
* @return float
- * @return the value of field 'value'.
*/
- public float getValue()
+ public float[] getValue()
{
- return this._value;
- } //-- float getValue()
+ int size = _valueList.size();
+ float[] mArray = new float[size];
+ for (int index = 0; index < size; index++) {
+ mArray[index] = ((java.lang.Float)_valueList.elementAt(index)).floatValue();
+ }
+ return mArray;
+ } //-- float[] getValue()
/**
- * Method hasPosition
+ * Method getValueCount
+ *
+ *
+ *
+ * @return int
+ */
+ public int getValueCount()
+ {
+ return _valueList.size();
+ } //-- int getValueCount()
+
+ /**
+ * Method hasAfter
*
*
*
* @return boolean
*/
- public boolean hasPosition()
+ public boolean hasAfter()
{
- return this._has_position;
- } //-- boolean hasPosition()
+ return this._has_after;
+ } //-- boolean hasAfter()
/**
- * Method hasValue
+ * Method hasPosition
*
*
*
* @return boolean
*/
- public boolean hasValue()
+ public boolean hasPosition()
{
- return this._has_value;
- } //-- boolean hasValue()
+ return this._has_position;
+ } //-- boolean hasPosition()
/**
* Method isValid
} //-- void marshal(org.xml.sax.ContentHandler)
/**
- * Sets the value of field 'description'.
+ * Method removeAllGlyph
+ *
+ */
+ public void removeAllGlyph()
+ {
+ _glyphList.removeAllElements();
+ } //-- void removeAllGlyph()
+
+ /**
+ * Method removeAllValue
+ *
+ */
+ public void removeAllValue()
+ {
+ _valueList.removeAllElements();
+ } //-- void removeAllValue()
+
+ /**
+ * Method removeGlyph
+ *
+ *
+ *
+ * @param index
+ * @return Glyph
+ */
+ public org.vamsas.objects.core.Glyph removeGlyph(int index)
+ {
+ java.lang.Object obj = _glyphList.elementAt(index);
+ _glyphList.removeElementAt(index);
+ return (org.vamsas.objects.core.Glyph) obj;
+ } //-- org.vamsas.objects.core.Glyph removeGlyph(int)
+
+ /**
+ * Method removeValue
+ *
+ *
+ *
+ * @param index
+ * @return float
+ */
+ public float removeValue(int index)
+ {
+ java.lang.Object obj = _valueList.elementAt(index);
+ _valueList.removeElementAt(index);
+ return ((java.lang.Float)obj).floatValue();
+ } //-- float removeValue(int)
+
+ /**
+ * Sets the value of field 'after'. The field 'after' has the
+ * following description: true means the annotation element
+ * appears
+ * between the specified position and the next
+ *
+ *
+ * @param after the value of field 'after'.
+ */
+ public void setAfter(boolean after)
+ {
+ this._after = after;
+ this._has_after = true;
+ } //-- void setAfter(boolean)
+
+ /**
+ * Sets the value of field 'description'. The field
+ * 'description' has the following description: Free text at
+ * this position
+ *
*
* @param description the value of field 'description'.
*/
} //-- void setDescription(java.lang.String)
/**
- * Sets the value of field 'displayCharacter'.
+ * Method setGlyph
+ *
*
- * @param displayCharacter the value of field 'displayCharacter'
+ *
+ * @param index
+ * @param vGlyph
*/
- public void setDisplayCharacter(java.lang.String displayCharacter)
+ public void setGlyph(int index, org.vamsas.objects.core.Glyph vGlyph)
+ throws java.lang.IndexOutOfBoundsException
{
- this._displayCharacter = displayCharacter;
- } //-- void setDisplayCharacter(java.lang.String)
+ //-- check bounds for index
+ if ((index < 0) || (index > _glyphList.size())) {
+ throw new IndexOutOfBoundsException("setGlyph: Index value '"+index+"' not in range [0.."+_glyphList.size()+ "]");
+ }
+ _glyphList.setElementAt(vGlyph, index);
+ } //-- void setGlyph(int, org.vamsas.objects.core.Glyph)
/**
- * Sets the value of field 'id'.
+ * Method setGlyph
+ *
+ *
+ *
+ * @param glyphArray
+ */
+ public void setGlyph(org.vamsas.objects.core.Glyph[] glyphArray)
+ {
+ //-- copy array
+ _glyphList.removeAllElements();
+ for (int i = 0; i < glyphArray.length; i++) {
+ _glyphList.addElement(glyphArray[i]);
+ }
+ } //-- void setGlyph(org.vamsas.objects.core.Glyph)
+
+ /**
+ * Sets the value of field 'id'. The field 'id' has the
+ * following description: Primary Key for vamsas object
+ * referencing
+ *
*
* @param id the value of field 'id'.
*/
} //-- void setId(java.lang.String)
/**
- * Sets the value of field 'position'.
+ * Sets the value of field 'position'. The field 'position' has
+ * the following description: position with respect to the
+ * coordinate frame
+ * defined by a rangeType specification
+ *
*
* @param position the value of field 'position'.
*/
} //-- void setPosition(int)
/**
- * Sets the value of field 'secondaryStructure'.
+ * Method setValue
+ *
+ *
*
- * @param secondaryStructure the value of field
- * 'secondaryStructure'.
+ * @param index
+ * @param vValue
*/
- public void setSecondaryStructure(java.lang.String secondaryStructure)
+ public void setValue(int index, float vValue)
+ throws java.lang.IndexOutOfBoundsException
{
- this._secondaryStructure = secondaryStructure;
- } //-- void setSecondaryStructure(java.lang.String)
+ //-- check bounds for index
+ if ((index < 0) || (index > _valueList.size())) {
+ throw new IndexOutOfBoundsException("setValue: Index value '"+index+"' not in range [0.."+_valueList.size()+ "]");
+ }
+ _valueList.setElementAt(new java.lang.Float(vValue), index);
+ } //-- void setValue(int, float)
/**
- * Sets the value of field 'value'.
+ * Method setValue
+ *
*
- * @param value the value of field 'value'.
+ *
+ * @param valueArray
*/
- public void setValue(float value)
+ public void setValue(float[] valueArray)
{
- this._value = value;
- this._has_value = true;
+ //-- copy array
+ _valueList.removeAllElements();
+ for (int i = 0; i < valueArray.length; i++) {
+ _valueList.addElement(new java.lang.Float(valueArray[i]));
+ }
} //-- void setValue(float)
/**