uk.ac.vamsas.objects.core
Class AnnotationElement

java.lang.Object
  extended byuk.ac.vamsas.client.Vobject
      extended byuk.ac.vamsas.objects.core.AnnotationElement
All Implemented Interfaces:
java.io.Serializable

public class AnnotationElement
extends Vobject
implements java.io.Serializable

Class AnnotationElement.

Version:
$Revision: 496 $ $Date: 2007-06-28 14:51:44 +0100 (Thu, 28 Jun 2007) $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class uk.ac.vamsas.client.Vobject
__added_since_last_read, __last_hash, __stored_in_document, __updated_since_last_read, __visited, __vorba, registerable, V_parent, vorbaId
 
Constructor Summary
AnnotationElement()
           
 
Method Summary
 void addGlyph(Glyph vGlyph)
           
 void addGlyph(int index, Glyph vGlyph)
           
 void addValue(float vValue)
           
 void addValue(int index, float vValue)
           
 void deleteAfter()
           
 void deletePosition()
           
 java.util.Enumeration enumerateGlyph()
          Method enumerateGlyph.
 java.util.Enumeration enumerateValue()
          Method enumerateValue.
 boolean equals(java.lang.Object obj)
          Overrides the java.lang.Object.equals method.
 boolean getAfter()
          Returns the value of field 'after'.
 java.lang.String getDescription()
          Returns the value of field 'description'.
 Glyph[] getGlyph()
          Method getGlyph.Returns the contents of the collection in an Array.
 Glyph getGlyph(int index)
          Method getGlyph.
 java.util.Vector getGlyphAsReference()
          Method getGlyphAsReference.Returns a reference to '_glyphList'.
 int getGlyphCount()
          Method getGlyphCount.
 java.lang.String getId()
          Returns the value of field 'id'.
 long getPosition()
          Returns the value of field 'position'.
 float[] getValue()
          Method getValue.Returns the contents of the collection in an Array.
 float getValue(int index)
          Method getValue.
 java.util.Vector getValueAsReference()
          Method getValueAsReference.Returns a reference to '_valueList'.
 int getValueCount()
          Method getValueCount.
 boolean hasAfter()
          Method hasAfter.
 int hashCode()
          Overrides the java.lang.Object.hashCode method.
 boolean hasPosition()
          Method hasPosition.
 boolean isAfter()
          Returns the value of field 'after'.
 boolean isValid()
          Method isValid.
 void marshal(org.xml.sax.ContentHandler handler)
           
 void marshal(java.io.Writer out)
           
 void removeAllGlyph()
           
 void removeAllValue()
           
 boolean removeGlyph(Glyph vGlyph)
          Method removeGlyph.
 Glyph removeGlyphAt(int index)
          Method removeGlyphAt.
 boolean removeValue(float vValue)
          Method removeValue.
 float removeValueAt(int index)
          Method removeValueAt.
 void setAfter(boolean after)
          Sets the value of field 'after'.
 void setDescription(java.lang.String description)
          Sets the value of field 'description'.
 void setGlyph(Glyph[] vGlyphArray)
           
 void setGlyph(int index, Glyph vGlyph)
           
 void setGlyph(java.util.Vector vGlyphList)
          Sets the value of '_glyphList' by copying the given Vector.
 void setGlyphAsReference(java.util.Vector glyphVector)
          Deprecated.  
 void setId(java.lang.String id)
          Sets the value of field 'id'.
 void setPosition(long position)
          Sets the value of field 'position'.
 void setValue(float[] vValueArray)
           
 void setValue(int index, float vValue)
           
 void setValue(java.util.Vector vValueList)
          Sets the value of '_valueList' by copying the given Vector.
 void setValueAsReference(java.util.Vector valueVector)
          Deprecated.  
static AnnotationElement unmarshal(java.io.Reader reader)
          Method unmarshal.
 void validate()
           
 
Methods inherited from class uk.ac.vamsas.client.Vobject
__callHash, __ensure_instance_ids, __ensure_instance_ids, __getInstanceIdField, __getLHash, __setFinalHash, __setInitHash, doHash, finalize, get__last_hash, getV_parent, getVorbaId, is__stored_in_document, isNewInDocument, isRegisterable, isRegistered, isUpdated, merge, set__added_since_last_read, set__stored_in_document, set__updated_since_last_read, setInstanceIdField, setRegisterable, setV_parent, setVorbaId
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationElement

public AnnotationElement()
Method Detail

addGlyph

public void addGlyph(Glyph vGlyph)
              throws java.lang.IndexOutOfBoundsException
Parameters:
vGlyph -
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addGlyph

public void addGlyph(int index,
                     Glyph vGlyph)
              throws java.lang.IndexOutOfBoundsException
Parameters:
index -
vGlyph -
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addValue

public void addValue(float vValue)
              throws java.lang.IndexOutOfBoundsException
Parameters:
vValue -
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addValue

public void addValue(int index,
                     float vValue)
              throws java.lang.IndexOutOfBoundsException
Parameters:
index -
vValue -
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

deleteAfter

public void deleteAfter()

deletePosition

public void deletePosition()

enumerateGlyph

public java.util.Enumeration enumerateGlyph()
Method enumerateGlyph.

Returns:
an Enumeration over all uk.ac.vamsas.objects.core.Glyph elements

enumerateValue

public java.util.Enumeration enumerateValue()
Method enumerateValue.

Returns:
an Enumeration over all float elements

equals

public boolean equals(java.lang.Object obj)
Overrides the java.lang.Object.equals method.

Parameters:
obj -
Returns:
true if the objects are equal.

getAfter

public boolean getAfter()
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

Returns:
the value of field 'After'.

getDescription

public java.lang.String getDescription()
Returns the value of field 'description'. The field 'description' has the following description: Free text at this position

Returns:
the value of field 'Description'.

getGlyph

public Glyph getGlyph(int index)
               throws java.lang.IndexOutOfBoundsException
Method getGlyph.

Parameters:
index -
Returns:
the value of the uk.ac.vamsas.objects.core.Glyph at the given index
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

getGlyph

public Glyph[] getGlyph()
Method getGlyph.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.

Returns:
this collection as an Array

getGlyphAsReference

public java.util.Vector getGlyphAsReference()
Method getGlyphAsReference.Returns a reference to '_glyphList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getGlyphCount

public int getGlyphCount()
Method getGlyphCount.

Returns:
the size of this collection

getId

public java.lang.String getId()
Returns the value of field 'id'. The field 'id' has the following description: Primary Key for vamsas object referencing

Returns:
the value of field 'Id'.

getPosition

public long getPosition()
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

Returns:
the value of field 'Position'.

getValue

public float getValue(int index)
               throws java.lang.IndexOutOfBoundsException
Method getValue.

Parameters:
index -
Returns:
the value of the float at the given index
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

getValue

public float[] getValue()
Method getValue.Returns the contents of the collection in an Array.

Returns:
this collection as an Array

getValueAsReference

public java.util.Vector getValueAsReference()
Method getValueAsReference.Returns a reference to '_valueList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getValueCount

public int getValueCount()
Method getValueCount.

Returns:
the size of this collection

hasAfter

public boolean hasAfter()
Method hasAfter.

Returns:
true if at least one After has been added

hasPosition

public boolean hasPosition()
Method hasPosition.

Returns:
true if at least one Position has been added

hashCode

public int hashCode()
Overrides the java.lang.Object.hashCode method.

The following steps came from Effective Java Programming Language Guide by Joshua Bloch, Chapter 3

Overrides:
hashCode in class Vobject
Returns:
a hash code value for the object.

isAfter

public boolean isAfter()
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

Returns:
the value of field 'After'.

isValid

public boolean isValid()
Method isValid.

Returns:
true if this object is valid according to the schema

marshal

public void marshal(java.io.Writer out)
             throws org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Parameters:
out -
Throws:
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema

marshal

public void marshal(org.xml.sax.ContentHandler handler)
             throws java.io.IOException,
                    org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Parameters:
handler -
Throws:
java.io.IOException - if an IOException occurs during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling

removeAllGlyph

public void removeAllGlyph()

removeAllValue

public void removeAllValue()

removeGlyph

public boolean removeGlyph(Glyph vGlyph)
Method removeGlyph.

Parameters:
vGlyph -
Returns:
true if the object was removed from the collection.

removeGlyphAt

public Glyph removeGlyphAt(int index)
Method removeGlyphAt.

Parameters:
index -
Returns:
the element removed from the collection

removeValue

public boolean removeValue(float vValue)
Method removeValue.

Parameters:
vValue -
Returns:
true if the object was removed from the collection.

removeValueAt

public float removeValueAt(int index)
Method removeValueAt.

Parameters:
index -
Returns:
the element removed from the collection

setAfter

public void setAfter(boolean after)
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

Parameters:
after - the value of field 'after'.

setDescription

public void setDescription(java.lang.String description)
Sets the value of field 'description'. The field 'description' has the following description: Free text at this position

Parameters:
description - the value of field 'description'.

setGlyph

public void setGlyph(int index,
                     Glyph vGlyph)
              throws java.lang.IndexOutOfBoundsException
Parameters:
index -
vGlyph -
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setGlyph

public void setGlyph(Glyph[] vGlyphArray)
Parameters:
vGlyphArray -

setGlyph

public void setGlyph(java.util.Vector vGlyphList)
Sets the value of '_glyphList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vGlyphList - the Vector to copy.

setGlyphAsReference

public void setGlyphAsReference(java.util.Vector glyphVector)
Deprecated.  

Sets the value of '_glyphList' by setting it to the given Vector. No type checking is performed.

Parameters:
glyphVector - the Vector to set.

setId

public void setId(java.lang.String id)
Sets the value of field 'id'. The field 'id' has the following description: Primary Key for vamsas object referencing

Parameters:
id - the value of field 'id'.

setPosition

public void setPosition(long 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

Parameters:
position - the value of field 'position'.

setValue

public void setValue(int index,
                     float vValue)
              throws java.lang.IndexOutOfBoundsException
Parameters:
index -
vValue -
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setValue

public void setValue(float[] vValueArray)
Parameters:
vValueArray -

setValue

public void setValue(java.util.Vector vValueList)
Sets the value of '_valueList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vValueList - the Vector to copy.

setValueAsReference

public void setValueAsReference(java.util.Vector valueVector)
Deprecated.  

Sets the value of '_valueList' by setting it to the given Vector. No type checking is performed.

Parameters:
valueVector - the Vector to set.

unmarshal

public static AnnotationElement unmarshal(java.io.Reader reader)
                                   throws org.exolab.castor.xml.MarshalException,
                                          org.exolab.castor.xml.ValidationException
Method unmarshal.

Parameters:
reader -
Returns:
the unmarshaled uk.ac.vamsas.objects.core.AnnotationElement
Throws:
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema

validate

public void validate()
              throws org.exolab.castor.xml.ValidationException
Throws:
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema