OME
Interface OMEObject

All Known Subinterfaces:
ModelElement, ModelLink, ModelObject, OMEElement, OMELink, ViewElement, ViewLink, ViewObject

public interface OMEObject

This interface describes the fundamental methods that need to be implemented by all model and view objects in OME. These classes (this one, along with OMEElement and OMELink) are useful in generalizing the features of Objects (be they ViewObject or ModelObjects), but ideally these should not be passed around. Generally a user of these classes should know if they are working with model objects or view objects.


Method Summary
 void addLink(OMELink link)
          Adds an OMELink to the object's collection of links.
 java.lang.String getComment()
          Returns the comment of the object.
 int getID()
          Returns the unique (within its view) integer ID of the object.
 java.util.Collection getLinks()
          Returns a collection of OMELinks for this OMEObject.
 OMEModel getModel()
          Returns which model this object is in.
 java.lang.String getName()
          Returns the name or annotation of the object.
 java.lang.Object getType()
          Returns this object's type.
 void setComment(java.lang.String newcomment)
          Set the comment for the object.
 void setID(int id)
          Set the id for this object.
 void setName(java.lang.String newname)
          Set the name or annotation of this object.
 void setType(java.lang.Object type)
          Set the type of this object.
 

Method Detail

getName

public java.lang.String getName()
Returns the name or annotation of the object. This may return null.

setName

public void setName(java.lang.String newname)
             throws java.lang.Exception
Set the name or annotation of this object.
Parameters:
newname - the name to be set for this object.

getComment

public java.lang.String getComment()
Returns the comment of the object. This may return null.

setComment

public void setComment(java.lang.String newcomment)
Set the comment for the object.

getModel

public OMEModel getModel()
Returns which model this object is in.

getType

public java.lang.Object getType()
Returns this object's type.

setType

public void setType(java.lang.Object type)
             throws java.lang.Exception
Set the type of this object.
Parameters:
type - the type which this object should be set to.

getID

public int getID()
Returns the unique (within its view) integer ID of the object. The annotation/name of a link is optional, so this serves to identify the link when iterating. Multiple elements may share the same name with varying semantics, so again the name does not serve as an adequate identifier

getLinks

public java.util.Collection getLinks()
Returns a collection of OMELinks for this OMEObject. This collection is writable, but one should really use the addLink method.
See Also:
addLink()

addLink

public void addLink(OMELink link)
Adds an OMELink to the object's collection of links.
Parameters:
link - the OMELink to be added.

setID

public void setID(int id)
Set the id for this object.
Parameters:
id - the id which we should set for this OMEObject.