org.eclipse.higgins.idas
Interface IEntity

Package class diagram package IEntity
All Known Subinterfaces:
IDigitalSubject, IResource
All Known Implementing Classes:
BasicEntity, BasicResource

public interface IEntity

An Entity is a super-type for Digital Subjects and Resources. An Entity is comprised of a Name (identifier), Type, and Attributes.


Method Summary
 void addAttribute(IAttribute attribute)
           
 IAttribute createAttribute(URI type, IPropertyValue value)
          Creates and adds an attribute for this Entity.
 IAttribute createAttribute(URI type, Iterable<IPropertyValue> values)
          Creates and adds an attribute for this Entity.
 IAttribute getAttribute(URI attrID)
          Return specified attribute of this Entity
 Iterable<IAttribute> getAttributes()
          Return all attributes of this Entity
 String getName()
           
 String getType()
          Returns the type of this Entity.
As all Entities are required to have a type attribute, this is a shortcut for calling getAttribute("<URI of type attrID>").
 void removeAttribute(IAttribute attribute)
           
 

Method Detail

getName

String getName()
               throws IdASException
Throws:
IdASException

getType

String getType()
               throws IdASException
Returns the type of this Entity.
As all Entities are required to have a type attribute, this is a shortcut for calling getAttribute("<URI of type attrID>"). TODO: The above comment presumes we have a higgins-defined attribute type called "type". Do we need this? TODO: We decided to make the type be a String rather than URI -- need to remember why, and document it.

Returns:
The type of this Entity.
Throws:
IdASException

createAttribute

IAttribute createAttribute(URI type,
                           IPropertyValue value)
                           throws IdASException
Creates and adds an attribute for this Entity.

Parameters:
type - The attribute's type.
value - The attribute's value.
Returns:
The resulting Attribute.
Throws:
IdASException

createAttribute

IAttribute createAttribute(URI type,
                           Iterable<IPropertyValue> values)
                           throws IdASException
Creates and adds an attribute for this Entity.

Parameters:
type - The attribute's type.
values - The attribute's values.
Returns:
The resulting Attribute.
Throws:
IdASException

addAttribute

void addAttribute(IAttribute attribute)
                  throws IdASException
Throws:
IdASException

removeAttribute

void removeAttribute(IAttribute attribute)
                     throws IdASException
Throws:
IdASException

getAttributes

Iterable<IAttribute> getAttributes()
                                   throws IdASException
Return all attributes of this Entity

Returns:
An Iterable object of IAttributes.
Throws:
IdASException

getAttribute

IAttribute getAttribute(URI attrID)
                        throws IdASException
Return specified attribute of this Entity

Parameters:
attrID - The identifier of the attribute to be returned.
Returns:
An IAttribute or null if none exits.
Throws:
IdASException