org.LexGrid.relations
Class Relations

java.lang.Object
  extended by org.LexGrid.commonTypes.Describable
      extended by org.LexGrid.relations.Relations
All Implemented Interfaces:
java.io.Serializable

public class Relations
extends Describable
implements java.io.Serializable

A collection of relations that represent a particular point of view or community.

Version:
$Revision$ $Date$
See Also:
Serialized Form

Constructor Summary
Relations()
           
 
Method Summary
 void addAssociation(Association vAssociation)
           
 void addAssociation(int index, Association vAssociation)
           
 void addSource(int index, Source vSource)
           
 void addSource(Source vSource)
           
 java.util.Enumeration<Association> enumerateAssociation()
          Method enumerateAssociation.
 java.util.Enumeration<Source> enumerateSource()
          Method enumerateSource.
 Association[] getAssociation()
          Method getAssociation.Returns the contents of the collection in an Array.
 Association getAssociation(int index)
          Method getAssociation.
 int getAssociationCount()
          Method getAssociationCount.
 java.lang.String getContainerName()
          Returns the value of field 'containerName'.
 java.lang.Boolean getIsNative()
          Returns the value of field 'isNative'.
 Source[] getSource()
          Method getSource.Returns the contents of the collection in an Array.
 Source getSource(int index)
          Method getSource.
 int getSourceCount()
          Method getSourceCount.
 java.lang.Boolean isIsNative()
          Returns the value of field 'isNative'.
 boolean isValid()
          Method isValid.
 java.util.Iterator<Association> iterateAssociation()
          Method iterateAssociation.
 java.util.Iterator<Source> iterateSource()
          Method iterateSource.
 void marshal(org.xml.sax.ContentHandler handler)
           
 void marshal(java.io.Writer out)
           
 void removeAllAssociation()
           
 void removeAllSource()
           
 boolean removeAssociation(Association vAssociation)
          Method removeAssociation.
 Association removeAssociationAt(int index)
          Method removeAssociationAt.
 boolean removeSource(Source vSource)
          Method removeSource.
 Source removeSourceAt(int index)
          Method removeSourceAt.
 void setAssociation(Association[] vAssociationArray)
           
 void setAssociation(int index, Association vAssociation)
           
 void setContainerName(java.lang.String containerName)
          Sets the value of field 'containerName'.
 void setIsNative(java.lang.Boolean isNative)
          Sets the value of field 'isNative'.
 void setSource(int index, Source vSource)
           
 void setSource(Source[] vSourceArray)
           
static Relations unmarshalRelations(java.io.Reader reader)
          Method unmarshalRelations.
 void validate()
           
 
Methods inherited from class org.LexGrid.commonTypes.Describable
getEntityDescription, setEntityDescription, unmarshalDescribable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Relations

public Relations()
Method Detail

addAssociation

public void addAssociation(Association vAssociation)
                    throws java.lang.IndexOutOfBoundsException
Parameters:
vAssociation -
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addAssociation

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

addSource

public void addSource(Source vSource)
               throws java.lang.IndexOutOfBoundsException
Parameters:
vSource -
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addSource

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

enumerateAssociation

public java.util.Enumeration<Association> enumerateAssociation()
Method enumerateAssociation.

Returns:
an Enumeration over all possible elements of this collection

enumerateSource

public java.util.Enumeration<Source> enumerateSource()
Method enumerateSource.

Returns:
an Enumeration over all possible elements of this collection

getAssociation

public Association getAssociation(int index)
                           throws java.lang.IndexOutOfBoundsException
Method getAssociation.

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

getAssociation

public Association[] getAssociation()
Method getAssociation.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

getAssociationCount

public int getAssociationCount()
Method getAssociationCount.

Returns:
the size of this collection

getContainerName

public java.lang.String getContainerName()
Returns the value of field 'containerName'. The field 'containerName' has the following description: The unique identifier of this collection. Required if there is more than one collection of relations in a coding scheme

Returns:
the value of field 'ContainerName'.

getIsNative

public java.lang.Boolean getIsNative()
Returns the value of field 'isNative'. The field 'isNative' has the following description: True means that this set of relations are considered native to the coding scheme itself.

Returns:
the value of field 'IsNative'.

getSource

public Source getSource(int index)
                 throws java.lang.IndexOutOfBoundsException
Method getSource.

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

getSource

public Source[] getSource()
Method getSource.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

getSourceCount

public int getSourceCount()
Method getSourceCount.

Returns:
the size of this collection

isIsNative

public java.lang.Boolean isIsNative()
Returns the value of field 'isNative'. The field 'isNative' has the following description: True means that this set of relations are considered native to the coding scheme itself.

Returns:
the value of field 'IsNative'.

isValid

public boolean isValid()
Method isValid.

Overrides:
isValid in class Describable
Returns:
true if this object is valid according to the schema

iterateAssociation

public java.util.Iterator<Association> iterateAssociation()
Method iterateAssociation.

Returns:
an Iterator over all possible elements in this collection

iterateSource

public java.util.Iterator<Source> iterateSource()
Method iterateSource.

Returns:
an Iterator over all possible elements in this collection

marshal

public void marshal(java.io.Writer out)
             throws org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Overrides:
marshal in class Describable
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 Describable
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

removeAllAssociation

public void removeAllAssociation()

removeAllSource

public void removeAllSource()

removeAssociation

public boolean removeAssociation(Association vAssociation)
Method removeAssociation.

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

removeAssociationAt

public Association removeAssociationAt(int index)
Method removeAssociationAt.

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

removeSource

public boolean removeSource(Source vSource)
Method removeSource.

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

removeSourceAt

public Source removeSourceAt(int index)
Method removeSourceAt.

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

setAssociation

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

setAssociation

public void setAssociation(Association[] vAssociationArray)
Parameters:
vAssociationArray -

setContainerName

public void setContainerName(java.lang.String containerName)
Sets the value of field 'containerName'. The field 'containerName' has the following description: The unique identifier of this collection. Required if there is more than one collection of relations in a coding scheme

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

setIsNative

public void setIsNative(java.lang.Boolean isNative)
Sets the value of field 'isNative'. The field 'isNative' has the following description: True means that this set of relations are considered native to the coding scheme itself.

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

setSource

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

setSource

public void setSource(Source[] vSourceArray)
Parameters:
vSourceArray -

unmarshalRelations

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

Parameters:
reader -
Returns:
the unmarshaled org.LexGrid.relations.Relations
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 Describable
Throws:
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.