uk.ac.vamsas.objects.core
Class DbRef

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

public class DbRef
extends Vobject
implements java.io.Serializable

Store a list of database references for this sequence record - with optional mapping from database sequence to the given sequence record

Version:
$Revision: 496 $ $Date: 2007-06-29 13:23:12 +0100 (Fri, 29 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
DbRef()
           
 
Method Summary
 void addLink(int index, Link vLink)
           
 void addLink(Link vLink)
           
 void addMap(int index, Map vMap)
           
 void addMap(Map vMap)
           
 void addProperty(int index, Property vProperty)
           
 void addProperty(Property vProperty)
           
 java.util.Enumeration enumerateLink()
          Method enumerateLink.
 java.util.Enumeration enumerateMap()
          Method enumerateMap.
 java.util.Enumeration enumerateProperty()
          Method enumerateProperty.
 boolean equals(java.lang.Object obj)
          Overrides the java.lang.Object.equals method.
 java.lang.String getAccessionId()
          Returns the value of field 'accessionId'.
 java.lang.String getId()
          Returns the value of field 'id'.
 Link[] getLink()
          Method getLink.Returns the contents of the collection in an Array.
 Link getLink(int index)
          Method getLink.
 java.util.Vector getLinkAsReference()
          Method getLinkAsReference.Returns a reference to '_linkList'.
 int getLinkCount()
          Method getLinkCount.
 Map[] getMap()
          Method getMap.Returns the contents of the collection in an Array.
 Map getMap(int index)
          Method getMap.
 java.util.Vector getMapAsReference()
          Method getMapAsReference.Returns a reference to '_mapList'.
 int getMapCount()
          Method getMapCount.
 Property[] getProperty()
          Method getProperty.Returns the contents of the collection in an Array.
 Property getProperty(int index)
          Method getProperty.
 java.util.Vector getPropertyAsReference()
          Method getPropertyAsReference.Returns a reference to '_propertyList'.
 int getPropertyCount()
          Method getPropertyCount.
 java.lang.String getSource()
          Returns the value of field 'source'.
 java.lang.String getVersion()
          Returns the value of field 'version'.
 int hashCode()
          Overrides the java.lang.Object.hashCode method.
 boolean isValid()
          Method isValid.
 void marshal(org.xml.sax.ContentHandler handler)
           
 void marshal(java.io.Writer out)
           
 void removeAllLink()
           
 void removeAllMap()
           
 void removeAllProperty()
           
 boolean removeLink(Link vLink)
          Method removeLink.
 Link removeLinkAt(int index)
          Method removeLinkAt.
 boolean removeMap(Map vMap)
          Method removeMap.
 Map removeMapAt(int index)
          Method removeMapAt.
 boolean removeProperty(Property vProperty)
          Method removeProperty.
 Property removePropertyAt(int index)
          Method removePropertyAt.
 void setAccessionId(java.lang.String accessionId)
          Sets the value of field 'accessionId'.
 void setId(java.lang.String id)
          Sets the value of field 'id'.
 void setLink(int index, Link vLink)
           
 void setLink(Link[] vLinkArray)
           
 void setLink(java.util.Vector vLinkList)
          Sets the value of '_linkList' by copying the given Vector.
 void setLinkAsReference(java.util.Vector linkVector)
          Deprecated.  
 void setMap(int index, Map vMap)
           
 void setMap(Map[] vMapArray)
           
 void setMap(java.util.Vector vMapList)
          Sets the value of '_mapList' by copying the given Vector.
 void setMapAsReference(java.util.Vector mapVector)
          Deprecated.  
 void setProperty(int index, Property vProperty)
           
 void setProperty(Property[] vPropertyArray)
           
 void setProperty(java.util.Vector vPropertyList)
          Sets the value of '_propertyList' by copying the given Vector.
 void setPropertyAsReference(java.util.Vector propertyVector)
          Deprecated.  
 void setSource(java.lang.String source)
          Sets the value of field 'source'.
 void setVersion(java.lang.String version)
          Sets the value of field 'version'.
static DbRef 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

DbRef

public DbRef()
Method Detail

addLink

public void addLink(Link vLink)
             throws java.lang.IndexOutOfBoundsException
Parameters:
vLink -
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addLink

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

addMap

public void addMap(Map vMap)
            throws java.lang.IndexOutOfBoundsException
Parameters:
vMap -
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addMap

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

addProperty

public void addProperty(Property vProperty)
                 throws java.lang.IndexOutOfBoundsException
Parameters:
vProperty -
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addProperty

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

enumerateLink

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

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

enumerateMap

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

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

enumerateProperty

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

Returns:
an Enumeration over all uk.ac.vamsas.objects.core.Property 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.

getAccessionId

public java.lang.String getAccessionId()
Returns the value of field 'accessionId'. The field 'accessionId' has the following description: TODO: make some specification of the database field from which this accessionId is taken from - should that be a special property of the dbRef object ?

Returns:
the value of field 'AccessionId'.

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'.

getLink

public Link getLink(int index)
             throws java.lang.IndexOutOfBoundsException
Method getLink.

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

getLink

public Link[] getLink()
Method getLink.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

getLinkAsReference

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

Returns:
a reference to the Vector backing this class

getLinkCount

public int getLinkCount()
Method getLinkCount.

Returns:
the size of this collection

getMap

public Map getMap(int index)
           throws java.lang.IndexOutOfBoundsException
Method getMap.

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

getMap

public Map[] getMap()
Method getMap.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

getMapAsReference

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

Returns:
a reference to the Vector backing this class

getMapCount

public int getMapCount()
Method getMapCount.

Returns:
the size of this collection

getProperty

public Property getProperty(int index)
                     throws java.lang.IndexOutOfBoundsException
Method getProperty.

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

getProperty

public Property[] getProperty()
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.

Returns:
this collection as an Array

getPropertyAsReference

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

Returns:
a reference to the Vector backing this class

getPropertyCount

public int getPropertyCount()
Method getPropertyCount.

Returns:
the size of this collection

getSource

public java.lang.String getSource()
Returns the value of field 'source'. The field 'source' has the following description: TODO Database Naming Convention: either start using LSID (so change type to URI) or leave this as an uncontrolled/unspecified string ID

Returns:
the value of field 'Source'.

getVersion

public java.lang.String getVersion()
Returns the value of field 'version'. The field 'version' has the following description: Version must be specified -

Returns:
the value of field 'Version'.

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.

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

removeAllLink

public void removeAllLink()

removeAllMap

public void removeAllMap()

removeAllProperty

public void removeAllProperty()

removeLink

public boolean removeLink(Link vLink)
Method removeLink.

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

removeLinkAt

public Link removeLinkAt(int index)
Method removeLinkAt.

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

removeMap

public boolean removeMap(Map vMap)
Method removeMap.

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

removeMapAt

public Map removeMapAt(int index)
Method removeMapAt.

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

removeProperty

public boolean removeProperty(Property vProperty)
Method removeProperty.

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

removePropertyAt

public Property removePropertyAt(int index)
Method removePropertyAt.

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

setAccessionId

public void setAccessionId(java.lang.String accessionId)
Sets the value of field 'accessionId'. The field 'accessionId' has the following description: TODO: make some specification of the database field from which this accessionId is taken from - should that be a special property of the dbRef object ?

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

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'.

setLink

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

setLink

public void setLink(Link[] vLinkArray)
Parameters:
vLinkArray -

setLink

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

Parameters:
vLinkList - the Vector to copy.

setLinkAsReference

public void setLinkAsReference(java.util.Vector linkVector)
Deprecated.  

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

Parameters:
linkVector - the Vector to set.

setMap

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

setMap

public void setMap(Map[] vMapArray)
Parameters:
vMapArray -

setMap

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

Parameters:
vMapList - the Vector to copy.

setMapAsReference

public void setMapAsReference(java.util.Vector mapVector)
Deprecated.  

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

Parameters:
mapVector - the Vector to set.

setProperty

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

setProperty

public void setProperty(Property[] vPropertyArray)
Parameters:
vPropertyArray -

setProperty

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

Parameters:
vPropertyList - the Vector to copy.

setPropertyAsReference

public void setPropertyAsReference(java.util.Vector propertyVector)
Deprecated.  

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

Parameters:
propertyVector - the Vector to set.

setSource

public void setSource(java.lang.String source)
Sets the value of field 'source'. The field 'source' has the following description: TODO Database Naming Convention: either start using LSID (so change type to URI) or leave this as an uncontrolled/unspecified string ID

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

setVersion

public void setVersion(java.lang.String version)
Sets the value of field 'version'. The field 'version' has the following description: Version must be specified -

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

unmarshal

public static DbRef 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.DbRef
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