org.LexGrid.concepts
Class Entities

java.lang.Object
  extended by org.LexGrid.concepts.Entities
All Implemented Interfaces:
java.io.Serializable

public class Entities
extends java.lang.Object
implements java.io.Serializable

A set of entity codes and their lexical descriptions

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

Constructor Summary
Entities()
           
 
Method Summary
 void addEntity(Entity vEntity)
           
 void addEntity(int index, Entity vEntity)
           
 java.util.Enumeration<Entity> enumerateEntity()
          Method enumerateEntity.
 Entity[] getEntity()
          Method getEntity.Returns the contents of the collection in an Array.
 Entity getEntity(int index)
          Method getEntity.
 int getEntityCount()
          Method getEntityCount.
 boolean isValid()
          Method isValid.
 java.util.Iterator<Entity> iterateEntity()
          Method iterateEntity.
 void marshal(org.xml.sax.ContentHandler handler)
           
 void marshal(java.io.Writer out)
           
 void removeAllEntity()
           
 boolean removeEntity(Entity vEntity)
          Method removeEntity.
 Entity removeEntityAt(int index)
          Method removeEntityAt.
 void setEntity(Entity[] vEntityArray)
           
 void setEntity(int index, Entity vEntity)
           
static Entities unmarshalEntities(java.io.Reader reader)
          Method unmarshalEntities.
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Entities

public Entities()
Method Detail

addEntity

public void addEntity(Entity vEntity)
               throws java.lang.IndexOutOfBoundsException
Parameters:
vEntity -
Throws:
java.lang.IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addEntity

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

enumerateEntity

public java.util.Enumeration<Entity> enumerateEntity()
Method enumerateEntity.

Returns:
an Enumeration over all possible elements of this collection

getEntity

public Entity getEntity(int index)
                 throws java.lang.IndexOutOfBoundsException
Method getEntity.

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

getEntity

public Entity[] getEntity()
Method getEntity.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

getEntityCount

public int getEntityCount()
Method getEntityCount.

Returns:
the size of this collection

isValid

public boolean isValid()
Method isValid.

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

iterateEntity

public java.util.Iterator<Entity> iterateEntity()
Method iterateEntity.

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

removeAllEntity

public void removeAllEntity()

removeEntity

public boolean removeEntity(Entity vEntity)
Method removeEntity.

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

removeEntityAt

public Entity removeEntityAt(int index)
Method removeEntityAt.

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

setEntity

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

setEntity

public void setEntity(Entity[] vEntityArray)
Parameters:
vEntityArray -

unmarshalEntities

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

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