org.LexGrid.REST.concepts
Class Comments

java.lang.Object
  extended by org.mayo.edu.lgModel.LexGridBase
      extended by org.LexGrid.REST.concepts.Comments
All Implemented Interfaces:
java.io.Serializable

public class Comments
extends LexGridBase
implements java.io.Serializable

Used to select all of the comments from an entity. The URL is actually not linkable directly

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

Constructor Summary
Comments()
           
 
Method Summary
 void addComment(Comment vComment)
           
 void addComment(int index, Comment vComment)
           
 java.util.Enumeration<? extends Comment> enumerateComment()
          Method enumerateComment.
 Comment[] getComment()
          Method getComment.Returns the contents of the collection in an Array.
 Comment getComment(int index)
          Method getComment.
 java.util.List<Comment> getCommentAsReference()
          Method getCommentAsReference.Returns a reference to '_commentList'.
 int getCommentCount()
          Method getCommentCount.
 boolean isValid()
          Method isValid.
 java.util.Iterator<? extends Comment> iterateComment()
          Method iterateComment.
 void marshal(org.xml.sax.ContentHandler handler)
           
 void marshal(java.io.Writer out)
           
 void removeAllComment()
           
 boolean removeComment(Comment vComment)
          Method removeComment.
 Comment removeCommentAt(int index)
          Method removeCommentAt.
 void setComment(Comment[] vCommentArray)
           
 void setComment(int index, Comment vComment)
           
 void setComment(java.util.List<Comment> vCommentList)
          Sets the value of '_commentList' by copying the given Vector.
 void setCommentAsReference(java.util.List<Comment> commentList)
          Deprecated.  
static Comments unmarshalComments(java.io.Reader reader)
          Method unmarshalComments.
 void validate()
           
 
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

Comments

public Comments()
Method Detail

addComment

public void addComment(Comment vComment)
                throws java.lang.IndexOutOfBoundsException
Parameters:
vComment -
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addComment

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

enumerateComment

public java.util.Enumeration<? extends Comment> enumerateComment()
Method enumerateComment.

Returns:
an Enumeration over all possible elements of this collection

getComment

public Comment getComment(int index)
                   throws java.lang.IndexOutOfBoundsException
Method getComment.

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

getComment

public Comment[] getComment()
Method getComment.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

getCommentAsReference

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

Returns:
a reference to the Vector backing this class

getCommentCount

public int getCommentCount()
Method getCommentCount.

Returns:
the size of this collection

isValid

public boolean isValid()
Method isValid.

Returns:
true if this object is valid according to the schema

iterateComment

public java.util.Iterator<? extends Comment> iterateComment()
Method iterateComment.

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

removeAllComment

public void removeAllComment()

removeComment

public boolean removeComment(Comment vComment)
Method removeComment.

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

removeCommentAt

public Comment removeCommentAt(int index)
Method removeCommentAt.

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

setComment

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

setComment

public void setComment(Comment[] vCommentArray)
Parameters:
vCommentArray -

setComment

public void setComment(java.util.List<Comment> vCommentList)
Sets the value of '_commentList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vCommentList - the Vector to copy.

setCommentAsReference

public void setCommentAsReference(java.util.List<Comment> commentList)
Deprecated. 

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

Parameters:
commentList - the Vector to set.

unmarshalComments

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

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

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.