org.eclipse.higgins.idas.api
Interface IHasMetadata

All Known Subinterfaces:
IAttribute, IAttributeValue, IComplexAttrValue, IComplexMetaValue, IContextRelation, IEntity, ISimpleAttrValue, ISingleValuedAttribute

public interface IHasMetadata

Extended by interfaces which have metadata associated with them.

TODO (Doc): Add (or point to) doc which explains metadata.


Method Summary
 IMetadata addMetadata(IMetadata copyFrom)
          Creates a new Metadata element for this container of metadata by copying the data from the passed IMetadata.
 IMetadata addMetadata(URI metadataType)
          Creates a new Metadata element for this container of metadata.
 boolean equals(IHasMetadata metadataSet)
          Returns true if the passed metadata set is equal to this one.
 IMetadata getMetadata(URI metadataType)
          Returns the specified metadata of this object.
 Iterator getMetadataSet()
          Returns this Object's metadata elements as an Iterable.
 

Method Detail

getMetadataSet

public Iterator getMetadataSet()
                        throws IdASException
Returns this Object's metadata elements as an Iterable. TODO (Arch): Consider overloading to take a metadata type (gets all metadata of that type)

Returns:
An Iterator of IMetadata
Throws:
IdASException

getMetadata

public IMetadata getMetadata(URI metadataType)
                      throws IdASException
Returns the specified metadata of this object.

Parameters:
metadataType - The identifier of the metadata to be returned.
Returns:
An IMetadata or if none exits.
Throws:
IdASException

addMetadata

public IMetadata addMetadata(URI metadataType)
                      throws IdASException,
                             InvalidTypeException
Creates a new Metadata element for this container of metadata. This call is typically followed by a call to IMetadata#setData(Object) on the returned IMetadata Note: This operation is only applied to any backing data store after IContext.applyUpdates() is called.

Parameters:
metadataType - The URI specifying the type of Metadata being created
Throws:
{@link - IdASException}
{@link - InvalidTypeException} when the metadataID is invalid
IdASException
InvalidTypeException

addMetadata

public IMetadata addMetadata(IMetadata copyFrom)
                      throws IdASException
Creates a new Metadata element for this container of metadata by copying the data from the passed IMetadata. Note: This operation is only applied to any backing data store after IContext.applyUpdates() is called.

Parameters:
copyFrom - an IMetadata from which data is copied to construct a new Metadata element.
Throws:
{@link - IdASException}
IdASException

equals

public boolean equals(IHasMetadata metadataSet)
               throws IdASException
Returns true if the passed metadata set is equal to this one. The sets are compared for size, and then each metadata item in the set is compared for equality

Parameters:
metadataSet - the set of metadata to compare to this one
Returns:
true if the sets are equal, false otherwise.
Throws:
IdASException