org.LexGrid.REST.relations
Class Relation

java.lang.Object
  extended by org.mayo.edu.lgModel.LexGridBase
      extended by org.LexGrid.commonTypes.Describable
          extended by org.LexGrid.REST.relations.Relation
All Implemented Interfaces:
java.io.Serializable

public class Relation
extends Describable
implements java.io.Serializable

A collection of association triples asserted from a particular perspective, use case or community point of view

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

Constructor Summary
Relation()
           
 
Method Summary
 void addSource(int index, Source vSource)
           
 void addSource(Source vSource)
           
 java.util.Enumeration<? extends Source> enumerateSource()
          Method enumerateSource.
 AssociationEntrySet getAssertions()
          Returns the value of field 'assertions'.
 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.
 java.util.List<Source> getSourceAsReference()
          Method getSourceAsReference.Returns a reference to '_sourceList'.
 int getSourceCount()
          Method getSourceCount.
 java.lang.Boolean isIsNative()
          Returns the value of field 'isNative'.
 boolean isValid()
          Method isValid.
 java.util.Iterator<? extends Source> iterateSource()
          Method iterateSource.
 void marshal(org.xml.sax.ContentHandler handler)
           
 void marshal(java.io.Writer out)
           
 void removeAllSource()
           
 boolean removeSource(Source vSource)
          Method removeSource.
 Source removeSourceAt(int index)
          Method removeSourceAt.
 void setAssertions(AssociationEntrySet assertions)
          Sets the value of field 'assertions'.
 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(java.util.List<Source> vSourceList)
          Sets the value of '_sourceList' by copying the given Vector.
 void setSource(Source[] vSourceArray)
           
 void setSourceAsReference(java.util.List<Source> sourceList)
          Deprecated.  
static Relation unmarshalRelation(java.io.Reader reader)
          Method unmarshalRelation.
 void validate()
           
 
Methods inherited from class org.LexGrid.commonTypes.Describable
getEntityDescription, setEntityDescription, unmarshalDescribable
 
Methods inherited from class org.mayo.edu.lgModel.LexGridBase
getParent, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Relation

public Relation()
Method Detail

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

enumerateSource

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

Returns:
an Enumeration over all possible elements of this collection

getAssertions

public AssociationEntrySet getAssertions()
Returns the value of field 'assertions'. The field 'assertions' has the following description: The collection of assertions that are represented.

Returns:
the value of field 'Assertions'.

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

getSourceAsReference

public java.util.List<Source> getSourceAsReference()
Method getSourceAsReference.Returns a reference to '_sourceList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

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

iterateSource

public java.util.Iterator<? extends 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

removeAllSource

public void removeAllSource()

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

setAssertions

public void setAssertions(AssociationEntrySet assertions)
Sets the value of field 'assertions'. The field 'assertions' has the following description: The collection of assertions that are represented.

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

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 -

setSource

public void setSource(java.util.List<Source> vSourceList)
Sets the value of '_sourceList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vSourceList - the Vector to copy.

setSourceAsReference

public void setSourceAsReference(java.util.List<Source> sourceList)
Deprecated. 

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

Parameters:
sourceList - the Vector to set.

unmarshalRelation

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

Parameters:
reader -
Returns:
the unmarshaled org.LexGrid.REST.relations.Relation
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.