uk.ac.vamsas.objects.core
Class ReferenceType

java.lang.Object
  extended byuk.ac.vamsas.client.Vobject
      extended byuk.ac.vamsas.objects.core.ReferenceType
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Vref, Vxref

public class ReferenceType
extends Vobject
implements java.io.Serializable

base type for citing arbitrary links between vamsas objects Optional human readable description of the relationship

Version:
$Revision$ $Date$
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
ReferenceType()
           
 
Method Summary
 void addRefs(int index, java.lang.Object vRefs)
           
 void addRefs(java.lang.Object vRefs)
           
 java.util.Enumeration enumerateRefs()
          Method enumerateRefs.
 boolean equals(java.lang.Object obj)
          Overrides the java.lang.Object.equals method.
 java.lang.String getContent()
          Returns the value of field 'content'.
 java.lang.String getId()
          Returns the value of field 'id'.
 java.lang.Object[] getRefs()
          Method getRefs.Returns the contents of the collection in an Array.
 java.lang.Object getRefs(int index)
          Method getRefs.
 java.util.Vector getRefsAsReference()
          Method getRefsAsReference.Returns a reference to '_refs'.
 int getRefsCount()
          Method getRefsCount.
 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 removeAllRefs()
           
 boolean removeRefs(java.lang.Object vRefs)
          Method removeRefs.
 java.lang.Object removeRefsAt(int index)
          Method removeRefsAt.
 void setContent(java.lang.String content)
          Sets the value of field 'content'.
 void setId(java.lang.String id)
          Sets the value of field 'id'.
 void setRefs(int index, java.lang.Object vRefs)
           
 void setRefs(java.lang.Object[] vRefsArray)
           
 void setRefs(java.util.Vector vRefsList)
          Sets the value of '_refs' by copying the given Vector.
 void setRefsAsReference(java.util.Vector refsVector)
          Deprecated.  
static ReferenceType 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

ReferenceType

public ReferenceType()
Method Detail

addRefs

public void addRefs(java.lang.Object vRefs)
             throws java.lang.IndexOutOfBoundsException
Parameters:
vRefs -
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addRefs

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

enumerateRefs

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

Returns:
an Enumeration over all java.lang.Object 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.

getContent

public java.lang.String getContent()
Returns the value of field 'content'. The field 'content' has the following description: internal content storage

Returns:
the value of field 'Content'.

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

getRefs

public java.lang.Object getRefs(int index)
                         throws java.lang.IndexOutOfBoundsException
Method getRefs.

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

getRefs

public java.lang.Object[] getRefs()
Method getRefs.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

getRefsAsReference

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

Returns:
a reference to the Vector backing this class

getRefsCount

public int getRefsCount()
Method getRefsCount.

Returns:
the size of this collection

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

removeAllRefs

public void removeAllRefs()

removeRefs

public boolean removeRefs(java.lang.Object vRefs)
Method removeRefs.

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

removeRefsAt

public java.lang.Object removeRefsAt(int index)
Method removeRefsAt.

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

setContent

public void setContent(java.lang.String content)
Sets the value of field 'content'. The field 'content' has the following description: internal content storage

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

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

setRefs

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

setRefs

public void setRefs(java.lang.Object[] vRefsArray)
Parameters:
vRefsArray -

setRefs

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

Parameters:
vRefsList - the Vector to copy.

setRefsAsReference

public void setRefsAsReference(java.util.Vector refsVector)
Deprecated.  

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

Parameters:
refsVector - the Vector to set.

unmarshal

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