uk.ac.vamsas.objects.core
Class Treenode

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

public class Treenode
extends NodeType
implements java.io.Serializable

node identity and mapping data between tree representations and vamsas document objects

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
Treenode()
           
 
Method Summary
 void addTreeId(int index, java.lang.Object vTreeId)
           
 void addTreeId(java.lang.Object vTreeId)
           
 java.util.Enumeration enumerateTreeId()
          Method enumerateTreeId.
 boolean equals(java.lang.Object obj)
          Overrides the java.lang.Object.equals method.
 java.lang.String getNodespec()
          Returns the value of field 'nodespec'.
 java.lang.Object[] getTreeId()
          Method getTreeId.Returns the contents of the collection in an Array.
 java.lang.Object getTreeId(int index)
          Method getTreeId.
 java.util.Vector getTreeIdAsReference()
          Method getTreeIdAsReference.Returns a reference to '_treeId'.
 int getTreeIdCount()
          Method getTreeIdCount.
 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 removeAllTreeId()
           
 boolean removeTreeId(java.lang.Object vTreeId)
          Method removeTreeId.
 java.lang.Object removeTreeIdAt(int index)
          Method removeTreeIdAt.
 void setNodespec(java.lang.String nodespec)
          Sets the value of field 'nodespec'.
 void setTreeId(int index, java.lang.Object vTreeId)
           
 void setTreeId(java.lang.Object[] vTreeIdArray)
           
 void setTreeId(java.util.Vector vTreeIdList)
          Sets the value of '_treeId' by copying the given Vector.
 void setTreeIdAsReference(java.util.Vector treeIdVector)
          Deprecated.  
static NodeType unmarshal(java.io.Reader reader)
          Method unmarshal.
 void validate()
           
 
Methods inherited from class uk.ac.vamsas.objects.core.NodeType
addProperty, addProperty, addVref, addVref, enumerateProperty, enumerateVref, getDescription, getId, getModifiable, getName, getProperty, getProperty, getPropertyAsReference, getPropertyCount, getVref, getVref, getVrefAsReference, getVrefCount, removeAllProperty, removeAllVref, removeProperty, removePropertyAt, removeVref, removeVrefAt, setDescription, setId, setModifiable, setName, setProperty, setProperty, setProperty, setPropertyAsReference, setVref, setVref, setVref, setVrefAsReference
 
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

Treenode

public Treenode()
Method Detail

addTreeId

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

addTreeId

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

enumerateTreeId

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

Returns:
an Enumeration over all java.lang.Object elements

equals

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

Overrides:
equals in class NodeType
Parameters:
obj -
Returns:
true if the objects are equal.

getNodespec

public java.lang.String getNodespec()
Returns the value of field 'nodespec'. The field 'nodespec' has the following description: String uniquely identifying a particular node in the referenced tree according to the format of the tree representation that is referenced.

Returns:
the value of field 'Nodespec'.

getTreeId

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

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

getTreeId

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

getTreeIdAsReference

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

Returns:
a reference to the Vector backing this class

getTreeIdCount

public int getTreeIdCount()
Method getTreeIdCount.

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 NodeType
Returns:
a hash code value for the object.

isValid

public boolean isValid()
Method isValid.

Overrides:
isValid in class NodeType
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
Overrides:
marshal in class NodeType
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
Overrides:
marshal in class NodeType
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

removeAllTreeId

public void removeAllTreeId()

removeTreeId

public boolean removeTreeId(java.lang.Object vTreeId)
Method removeTreeId.

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

removeTreeIdAt

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

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

setNodespec

public void setNodespec(java.lang.String nodespec)
Sets the value of field 'nodespec'. The field 'nodespec' has the following description: String uniquely identifying a particular node in the referenced tree according to the format of the tree representation that is referenced.

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

setTreeId

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

setTreeId

public void setTreeId(java.lang.Object[] vTreeIdArray)
Parameters:
vTreeIdArray -

setTreeId

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

Parameters:
vTreeIdList - the Vector to copy.

setTreeIdAsReference

public void setTreeIdAsReference(java.util.Vector treeIdVector)
Deprecated.  

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

Parameters:
treeIdVector - the Vector to set.

unmarshal

public static NodeType 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.NodeType
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
Overrides:
validate in class NodeType
Throws:
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema