uk.ac.vamsas.objects.core
Class Provenance

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

public class Provenance
extends Vobject
implements java.io.Serializable

Class Provenance.

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
Provenance()
           
 
Method Summary
 void addEntry(Entry vEntry)
           
 void addEntry(int index, Entry vEntry)
           
 java.util.Enumeration enumerateEntry()
          Method enumerateEntry.
 boolean equals(java.lang.Object obj)
          Overrides the java.lang.Object.equals method.
 Entry[] getEntry()
          Method getEntry.Returns the contents of the collection in an Array.
 Entry getEntry(int index)
          Method getEntry.
 java.util.Vector getEntryAsReference()
          Method getEntryAsReference.Returns a reference to '_entryList'.
 int getEntryCount()
          Method getEntryCount.
 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 removeAllEntry()
           
 boolean removeEntry(Entry vEntry)
          Method removeEntry.
 Entry removeEntryAt(int index)
          Method removeEntryAt.
 void setEntry(Entry[] vEntryArray)
           
 void setEntry(int index, Entry vEntry)
           
 void setEntry(java.util.Vector vEntryList)
          Sets the value of '_entryList' by copying the given Vector.
 void setEntryAsReference(java.util.Vector entryVector)
          Deprecated.  
static Provenance 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

Provenance

public Provenance()
Method Detail

addEntry

public void addEntry(Entry vEntry)
              throws java.lang.IndexOutOfBoundsException
Parameters:
vEntry -
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addEntry

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

enumerateEntry

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

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

getEntry

public Entry getEntry(int index)
               throws java.lang.IndexOutOfBoundsException
Method getEntry.

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

getEntry

public Entry[] getEntry()
Method getEntry.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

getEntryAsReference

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

Returns:
a reference to the Vector backing this class

getEntryCount

public int getEntryCount()
Method getEntryCount.

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

removeAllEntry

public void removeAllEntry()

removeEntry

public boolean removeEntry(Entry vEntry)
Method removeEntry.

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

removeEntryAt

public Entry removeEntryAt(int index)
Method removeEntryAt.

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

setEntry

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

setEntry

public void setEntry(Entry[] vEntryArray)
Parameters:
vEntryArray -

setEntry

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

Parameters:
vEntryList - the Vector to copy.

setEntryAsReference

public void setEntryAsReference(java.util.Vector entryVector)
Deprecated.  

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

Parameters:
entryVector - the Vector to set.

unmarshal

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