*
* @version $Revision$ $Date$
*/
-public class Alignment extends org.vamsas.client.object
+public class Alignment extends org.vamsas.client.Vobject
implements java.io.Serializable
{
//--------------------------/
/**
- * Field _id
+ * Field _gapChar
+ */
+ private java.lang.String _gapChar;
+
+ /**
+ * Field _aligned
+ */
+ private boolean _aligned;
+
+ /**
+ * keeps track of state for field: _aligned
+ */
+ private boolean _has_aligned;
+
+ /**
+ * Primary Key for vamsas object referencing
+ *
*/
private java.lang.String _id;
/**
- * Field _alignmentAnnotations
+ * Field _modifiable
+ */
+ private java.lang.String _modifiable;
+
+ /**
+ * This is annotation over the coordinate frame
+ * defined by all the columns in the alignment.
+ *
*/
- private org.vamsas.objects.core.AlignmentAnnotations _alignmentAnnotations;
+ private java.util.Vector _alignmentAnnotationList;
/**
* Field _treeList
private java.util.Vector _alignmentSequenceList;
/**
+ * typical properties may be additional
+ * alignment score objects
+ */
+ private java.util.Vector _propertyList;
+
+ /**
* Field _provenance
*/
private org.vamsas.objects.core.Provenance _provenance;
public Alignment()
{
super();
+ _alignmentAnnotationList = new Vector();
_treeList = new Vector();
_alignmentSequenceList = new Vector();
+ _propertyList = new Vector();
} //-- org.vamsas.objects.core.Alignment()
//-----------/
/**
+ * Method addAlignmentAnnotation
+ *
+ *
+ *
+ * @param vAlignmentAnnotation
+ */
+ public void addAlignmentAnnotation(org.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ _alignmentAnnotationList.addElement(vAlignmentAnnotation);
+ } //-- void addAlignmentAnnotation(org.vamsas.objects.core.AlignmentAnnotation)
+
+ /**
+ * Method addAlignmentAnnotation
+ *
+ *
+ *
+ * @param index
+ * @param vAlignmentAnnotation
+ */
+ public void addAlignmentAnnotation(int index, org.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ _alignmentAnnotationList.insertElementAt(vAlignmentAnnotation, index);
+ } //-- void addAlignmentAnnotation(int, org.vamsas.objects.core.AlignmentAnnotation)
+
+ /**
* Method addAlignmentSequence
*
*
} //-- void addAlignmentSequence(int, org.vamsas.objects.core.AlignmentSequence)
/**
+ * Method addProperty
+ *
+ *
+ *
+ * @param vProperty
+ */
+ public void addProperty(org.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ _propertyList.addElement(vProperty);
+ } //-- void addProperty(org.vamsas.objects.core.Property)
+
+ /**
+ * Method addProperty
+ *
+ *
+ *
+ * @param index
+ * @param vProperty
+ */
+ public void addProperty(int index, org.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ _propertyList.insertElementAt(vProperty, index);
+ } //-- void addProperty(int, org.vamsas.objects.core.Property)
+
+ /**
* Method addTree
*
*
} //-- void addTree(int, org.vamsas.objects.core.Tree)
/**
+ * Method deleteAligned
+ *
+ */
+ public void deleteAligned()
+ {
+ this._has_aligned= false;
+ } //-- void deleteAligned()
+
+ /**
+ * Method enumerateAlignmentAnnotation
+ *
+ *
+ *
+ * @return Enumeration
+ */
+ public java.util.Enumeration enumerateAlignmentAnnotation()
+ {
+ return _alignmentAnnotationList.elements();
+ } //-- java.util.Enumeration enumerateAlignmentAnnotation()
+
+ /**
* Method enumerateAlignmentSequence
*
*
} //-- java.util.Enumeration enumerateAlignmentSequence()
/**
+ * Method enumerateProperty
+ *
+ *
+ *
+ * @return Enumeration
+ */
+ public java.util.Enumeration enumerateProperty()
+ {
+ return _propertyList.elements();
+ } //-- java.util.Enumeration enumerateProperty()
+
+ /**
* Method enumerateTree
*
*
if (obj instanceof Alignment) {
Alignment temp = (Alignment)obj;
+ if (this._gapChar != null) {
+ if (temp._gapChar == null) return false;
+ else if (!(this._gapChar.equals(temp._gapChar)))
+ return false;
+ }
+ else if (temp._gapChar != null)
+ return false;
+ if (this._aligned != temp._aligned)
+ return false;
+ if (this._has_aligned != temp._has_aligned)
+ 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._alignmentAnnotations != null) {
- if (temp._alignmentAnnotations == null) return false;
- else if (!(this._alignmentAnnotations.equals(temp._alignmentAnnotations)))
+ if (this._modifiable != null) {
+ if (temp._modifiable == null) return false;
+ else if (!(this._modifiable.equals(temp._modifiable)))
return false;
}
- else if (temp._alignmentAnnotations != null)
+ else if (temp._modifiable != null)
+ return false;
+ if (this._alignmentAnnotationList != null) {
+ if (temp._alignmentAnnotationList == null) return false;
+ else if (!(this._alignmentAnnotationList.equals(temp._alignmentAnnotationList)))
+ return false;
+ }
+ else if (temp._alignmentAnnotationList != null)
return false;
if (this._treeList != null) {
if (temp._treeList == null) return false;
}
else if (temp._alignmentSequenceList != null)
return false;
+ if (this._propertyList != null) {
+ if (temp._propertyList == null) return false;
+ else if (!(this._propertyList.equals(temp._propertyList)))
+ return false;
+ }
+ else if (temp._propertyList != null)
+ return false;
if (this._provenance != null) {
if (temp._provenance == null) return false;
else if (!(this._provenance.equals(temp._provenance)))
} //-- boolean equals(java.lang.Object)
/**
- * Returns the value of field 'alignmentAnnotations'.
+ * Returns the value of field 'aligned'.
*
- * @return AlignmentAnnotations
- * @return the value of field 'alignmentAnnotations'.
+ * @return boolean
+ * @return the value of field 'aligned'.
*/
- public org.vamsas.objects.core.AlignmentAnnotations getAlignmentAnnotations()
+ public boolean getAligned()
{
- return this._alignmentAnnotations;
- } //-- org.vamsas.objects.core.AlignmentAnnotations getAlignmentAnnotations()
+ return this._aligned;
+ } //-- boolean getAligned()
+
+ /**
+ * Method getAlignmentAnnotation
+ *
+ *
+ *
+ * @param index
+ * @return AlignmentAnnotation
+ */
+ public org.vamsas.objects.core.AlignmentAnnotation getAlignmentAnnotation(int index)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ //-- check bounds for index
+ if ((index < 0) || (index > _alignmentAnnotationList.size())) {
+ throw new IndexOutOfBoundsException("getAlignmentAnnotation: Index value '"+index+"' not in range [0.."+_alignmentAnnotationList.size()+ "]");
+ }
+
+ return (org.vamsas.objects.core.AlignmentAnnotation) _alignmentAnnotationList.elementAt(index);
+ } //-- org.vamsas.objects.core.AlignmentAnnotation getAlignmentAnnotation(int)
+
+ /**
+ * Method getAlignmentAnnotation
+ *
+ *
+ *
+ * @return AlignmentAnnotation
+ */
+ public org.vamsas.objects.core.AlignmentAnnotation[] getAlignmentAnnotation()
+ {
+ int size = _alignmentAnnotationList.size();
+ org.vamsas.objects.core.AlignmentAnnotation[] mArray = new org.vamsas.objects.core.AlignmentAnnotation[size];
+ for (int index = 0; index < size; index++) {
+ mArray[index] = (org.vamsas.objects.core.AlignmentAnnotation) _alignmentAnnotationList.elementAt(index);
+ }
+ return mArray;
+ } //-- org.vamsas.objects.core.AlignmentAnnotation[] getAlignmentAnnotation()
+
+ /**
+ * Method getAlignmentAnnotationCount
+ *
+ *
+ *
+ * @return int
+ */
+ public int getAlignmentAnnotationCount()
+ {
+ return _alignmentAnnotationList.size();
+ } //-- int getAlignmentAnnotationCount()
/**
* Method getAlignmentSequence
} //-- int getAlignmentSequenceCount()
/**
- * Returns the value of field 'id'.
+ * Returns the value of field 'gapChar'.
+ *
+ * @return String
+ * @return the value of field 'gapChar'.
+ */
+ public java.lang.String getGapChar()
+ {
+ return this._gapChar;
+ } //-- java.lang.String getGapChar()
+
+ /**
+ * 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 'modifiable'.
+ *
+ * @return String
+ * @return the value of field 'modifiable'.
+ */
+ public java.lang.String getModifiable()
+ {
+ return this._modifiable;
+ } //-- java.lang.String getModifiable()
+
+ /**
+ * Method getProperty
+ *
+ *
+ *
+ * @param index
+ * @return Property
+ */
+ public org.vamsas.objects.core.Property getProperty(int index)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ //-- check bounds for index
+ if ((index < 0) || (index > _propertyList.size())) {
+ throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]");
+ }
+
+ return (org.vamsas.objects.core.Property) _propertyList.elementAt(index);
+ } //-- org.vamsas.objects.core.Property getProperty(int)
+
+ /**
+ * Method getProperty
+ *
+ *
+ *
+ * @return Property
+ */
+ public org.vamsas.objects.core.Property[] getProperty()
+ {
+ int size = _propertyList.size();
+ org.vamsas.objects.core.Property[] mArray = new org.vamsas.objects.core.Property[size];
+ for (int index = 0; index < size; index++) {
+ mArray[index] = (org.vamsas.objects.core.Property) _propertyList.elementAt(index);
+ }
+ return mArray;
+ } //-- org.vamsas.objects.core.Property[] getProperty()
+
+ /**
+ * Method getPropertyCount
+ *
+ *
+ *
+ * @return int
+ */
+ public int getPropertyCount()
+ {
+ return _propertyList.size();
+ } //-- int getPropertyCount()
+
+ /**
* Returns the value of field 'provenance'.
*
* @return Provenance
} //-- int getTreeCount()
/**
+ * Method hasAligned
+ *
+ *
+ *
+ * @return boolean
+ */
+ public boolean hasAligned()
+ {
+ return this._has_aligned;
+ } //-- boolean hasAligned()
+
+ /**
* Method isValid
*
*
} //-- void marshal(org.xml.sax.ContentHandler)
/**
+ * Method removeAlignmentAnnotation
+ *
+ *
+ *
+ * @param index
+ * @return AlignmentAnnotation
+ */
+ public org.vamsas.objects.core.AlignmentAnnotation removeAlignmentAnnotation(int index)
+ {
+ java.lang.Object obj = _alignmentAnnotationList.elementAt(index);
+ _alignmentAnnotationList.removeElementAt(index);
+ return (org.vamsas.objects.core.AlignmentAnnotation) obj;
+ } //-- org.vamsas.objects.core.AlignmentAnnotation removeAlignmentAnnotation(int)
+
+ /**
* Method removeAlignmentSequence
*
*
} //-- org.vamsas.objects.core.AlignmentSequence removeAlignmentSequence(int)
/**
+ * Method removeAllAlignmentAnnotation
+ *
+ */
+ public void removeAllAlignmentAnnotation()
+ {
+ _alignmentAnnotationList.removeAllElements();
+ } //-- void removeAllAlignmentAnnotation()
+
+ /**
* Method removeAllAlignmentSequence
*
*/
} //-- void removeAllAlignmentSequence()
/**
+ * Method removeAllProperty
+ *
+ */
+ public void removeAllProperty()
+ {
+ _propertyList.removeAllElements();
+ } //-- void removeAllProperty()
+
+ /**
* Method removeAllTree
*
*/
} //-- void removeAllTree()
/**
+ * Method removeProperty
+ *
+ *
+ *
+ * @param index
+ * @return Property
+ */
+ public org.vamsas.objects.core.Property removeProperty(int index)
+ {
+ java.lang.Object obj = _propertyList.elementAt(index);
+ _propertyList.removeElementAt(index);
+ return (org.vamsas.objects.core.Property) obj;
+ } //-- org.vamsas.objects.core.Property removeProperty(int)
+
+ /**
* Method removeTree
*
*
} //-- org.vamsas.objects.core.Tree removeTree(int)
/**
- * Sets the value of field 'alignmentAnnotations'.
+ * Sets the value of field 'aligned'.
+ *
+ * @param aligned the value of field 'aligned'.
+ */
+ public void setAligned(boolean aligned)
+ {
+ this._aligned = aligned;
+ this._has_aligned = true;
+ } //-- void setAligned(boolean)
+
+ /**
+ * Method setAlignmentAnnotation
+ *
+ *
+ *
+ * @param index
+ * @param vAlignmentAnnotation
+ */
+ public void setAlignmentAnnotation(int index, org.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ //-- check bounds for index
+ if ((index < 0) || (index > _alignmentAnnotationList.size())) {
+ throw new IndexOutOfBoundsException("setAlignmentAnnotation: Index value '"+index+"' not in range [0.."+_alignmentAnnotationList.size()+ "]");
+ }
+ _alignmentAnnotationList.setElementAt(vAlignmentAnnotation, index);
+ } //-- void setAlignmentAnnotation(int, org.vamsas.objects.core.AlignmentAnnotation)
+
+ /**
+ * Method setAlignmentAnnotation
+ *
+ *
*
- * @param alignmentAnnotations the value of field
- * 'alignmentAnnotations'.
+ * @param alignmentAnnotationArray
*/
- public void setAlignmentAnnotations(org.vamsas.objects.core.AlignmentAnnotations alignmentAnnotations)
+ public void setAlignmentAnnotation(org.vamsas.objects.core.AlignmentAnnotation[] alignmentAnnotationArray)
{
- this._alignmentAnnotations = alignmentAnnotations;
- } //-- void setAlignmentAnnotations(org.vamsas.objects.core.AlignmentAnnotations)
+ //-- copy array
+ _alignmentAnnotationList.removeAllElements();
+ for (int i = 0; i < alignmentAnnotationArray.length; i++) {
+ _alignmentAnnotationList.addElement(alignmentAnnotationArray[i]);
+ }
+ } //-- void setAlignmentAnnotation(org.vamsas.objects.core.AlignmentAnnotation)
/**
* Method setAlignmentSequence
} //-- void setAlignmentSequence(org.vamsas.objects.core.AlignmentSequence)
/**
- * Sets the value of field 'id'.
+ * Sets the value of field 'gapChar'.
+ *
+ * @param gapChar the value of field 'gapChar'.
+ */
+ public void setGapChar(java.lang.String gapChar)
+ {
+ this._gapChar = gapChar;
+ } //-- void setGapChar(java.lang.String)
+
+ /**
+ * 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 'modifiable'.
+ *
+ * @param modifiable the value of field 'modifiable'.
+ */
+ public void setModifiable(java.lang.String modifiable)
+ {
+ this._modifiable = modifiable;
+ } //-- void setModifiable(java.lang.String)
+
+ /**
+ * Method setProperty
+ *
+ *
+ *
+ * @param index
+ * @param vProperty
+ */
+ public void setProperty(int index, org.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ //-- check bounds for index
+ if ((index < 0) || (index > _propertyList.size())) {
+ throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]");
+ }
+ _propertyList.setElementAt(vProperty, index);
+ } //-- void setProperty(int, org.vamsas.objects.core.Property)
+
+ /**
+ * Method setProperty
+ *
+ *
+ *
+ * @param propertyArray
+ */
+ public void setProperty(org.vamsas.objects.core.Property[] propertyArray)
+ {
+ //-- copy array
+ _propertyList.removeAllElements();
+ for (int i = 0; i < propertyArray.length; i++) {
+ _propertyList.addElement(propertyArray[i]);
+ }
+ } //-- void setProperty(org.vamsas.objects.core.Property)
+
+ /**
* Sets the value of field 'provenance'.
*
* @param provenance the value of field 'provenance'.