org.eclipse.higgins.idas.spi
Class BasicAttribute

java.lang.Object
  extended byorg.eclipse.higgins.idas.spi.BasicAttribute
All Implemented Interfaces:
org.eclipse.higgins.idas.api.IAttribute, IAttributeValueContainer, org.eclipse.higgins.idas.api.IHasMetadata, IMetadataContainer
Direct Known Subclasses:
BasicSingleValuedAttribute

public class BasicAttribute
extends Object
implements org.eclipse.higgins.idas.api.IAttribute, IAttributeValueContainer, IMetadataContainer

Implements IAttribute using BasicAttribute and BasicMetadata


Constructor Summary
BasicAttribute(org.eclipse.higgins.idas.api.IAttribute copyFrom, IAttributeContainer container, org.eclipse.higgins.idas.api.IContext context)
          Note that the container's updateNotification is not called while the values in copyFrom are being copied.
BasicAttribute(URI attrID, org.eclipse.higgins.idas.api.IAttributeValue value, IAttributeContainer container, org.eclipse.higgins.idas.api.IContext context)
           
BasicAttribute(URI attrID, Iterator values, IAttributeContainer container, org.eclipse.higgins.idas.api.IContext context)
          Note that the container's updateNotification is not called while the IValues in values are being added.
BasicAttribute(URI attrID, Object data, IAttributeContainer container, org.eclipse.higgins.idas.api.IContext context)
           
 
Method Summary
 org.eclipse.higgins.idas.api.IComplexAttrValue addComplexValue(URI type)
           
 org.eclipse.higgins.idas.api.IMetadata addMetadata(org.eclipse.higgins.idas.api.IMetadata copyFrom)
           
 org.eclipse.higgins.idas.api.IMetadata addMetadata(URI type)
           
 org.eclipse.higgins.idas.api.ISimpleAttrValue addSimpleValue(URI type, Object data)
           
 org.eclipse.higgins.idas.api.IAttributeValue addValue(org.eclipse.higgins.idas.api.IAttributeValue copyFrom)
           
 org.eclipse.higgins.idas.api.IAttributeValue addValue(URI type)
           
 boolean equals(org.eclipse.higgins.idas.api.IAttribute attr)
           
 boolean equals(org.eclipse.higgins.idas.api.IHasMetadata metadataSet)
           
 URI getAttrID()
           
 IAttributeContainer getContainer()
           
 org.eclipse.higgins.idas.api.IMetadata getMetadata(URI metadataID)
           
 Iterator getMetadataSet()
           
 org.eclipse.higgins.idas.api.model.IAttributeModel getModel()
           
 Iterator getValues()
           
 boolean isSingleValued()
           
 void remove()
           
 void setContainer(IAttributeContainer container)
           
 void updateNotification(AttributeValueNotification attrValueNotif)
           
 void updateNotification(MetadataNotification metaNotif)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicAttribute

public BasicAttribute(org.eclipse.higgins.idas.api.IAttribute copyFrom,
                      IAttributeContainer container,
                      org.eclipse.higgins.idas.api.IContext context)
               throws org.eclipse.higgins.idas.api.IdASException
Note that the container's updateNotification is not called while the values in copyFrom are being copied.

Parameters:
copyFrom - IAttribute from which to copy data from
container - May be null. IAttributeContainer to send update notifications to.
context - May be null. IContext instance from which a model may be obtained if needed.
Throws:
org.eclipse.higgins.idas.api.IdASException

BasicAttribute

public BasicAttribute(URI attrID,
                      org.eclipse.higgins.idas.api.IAttributeValue value,
                      IAttributeContainer container,
                      org.eclipse.higgins.idas.api.IContext context)
               throws org.eclipse.higgins.idas.api.IdASException
Parameters:
attrID - the URI of the attribute's type
value - an IAttributeValue (either simple or complex) to store with the attribute
container - May be null. IAttributeContainer to send update notifications to.
context - May be null. IContext instance from which a model may be obtained if needed.
Throws:
org.eclipse.higgins.idas.api.IdASException

BasicAttribute

public BasicAttribute(URI attrID,
                      Object data,
                      IAttributeContainer container,
                      org.eclipse.higgins.idas.api.IContext context)
               throws org.eclipse.higgins.idas.api.IdASException
Parameters:
attrID - the URI of the attribute's type
data - an Object to be used as a value for attribute. The Object is the data from which an ISimpleAttrValue will be created. We do this by looking at the model for the attribute (sepcified in attrID) and associating that with the type of data object that is expected. If the value passed is of the wrong type, the constructor will fail. Note that this assumes the data will be used to construct a simple value, not a complex value. If one wishes to construct a BasicAttribute with a complex value, then #BasicAttribute(URI, IAttributeValue, IAttributeContainer) is called.
container - for purposes of notification of updates, the container of this attribute. May be null when there is no containing object
context - May be null. IContext instance from which a model may be obtained if needed.
Throws:
org.eclipse.higgins.idas.api.IdASException

BasicAttribute

public BasicAttribute(URI attrID,
                      Iterator values,
                      IAttributeContainer container,
                      org.eclipse.higgins.idas.api.IContext context)
               throws org.eclipse.higgins.idas.api.IdASException
Note that the container's updateNotification is not called while the IValues in values are being added.

Parameters:
attrID -
values - Contains IAttributeValues
container - May be null. IAttributeContainer to send update notifications to.
context - May be null. IContext instance from which a model may be obtained if needed.
Throws:
org.eclipse.higgins.idas.api.IdASException
Method Detail

getAttrID

public URI getAttrID()
              throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getAttrID in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException

getValues

public Iterator getValues()
                   throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getValues in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException

getModel

public org.eclipse.higgins.idas.api.model.IAttributeModel getModel()
                                                            throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getModel in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException

addComplexValue

public org.eclipse.higgins.idas.api.IComplexAttrValue addComplexValue(URI type)
                                                               throws org.eclipse.higgins.idas.api.IdASException,
                                                                      org.eclipse.higgins.idas.api.InvalidTypeException
Specified by:
addComplexValue in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.InvalidTypeException

addSimpleValue

public org.eclipse.higgins.idas.api.ISimpleAttrValue addSimpleValue(URI type,
                                                                    Object data)
                                                             throws org.eclipse.higgins.idas.api.IdASException,
                                                                    org.eclipse.higgins.idas.api.InvalidTypeException
Specified by:
addSimpleValue in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.InvalidTypeException

addValue

public org.eclipse.higgins.idas.api.IAttributeValue addValue(URI type)
                                                      throws org.eclipse.higgins.idas.api.IdASException,
                                                             org.eclipse.higgins.idas.api.InvalidTypeException
Specified by:
addValue in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.InvalidTypeException

addValue

public org.eclipse.higgins.idas.api.IAttributeValue addValue(org.eclipse.higgins.idas.api.IAttributeValue copyFrom)
                                                      throws org.eclipse.higgins.idas.api.IdASException
Specified by:
addValue in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException

remove

public void remove()
            throws org.eclipse.higgins.idas.api.IdASException
Specified by:
remove in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException

isSingleValued

public boolean isSingleValued()
Specified by:
isSingleValued in interface org.eclipse.higgins.idas.api.IAttribute

getMetadataSet

public Iterator getMetadataSet()
                        throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getMetadataSet in interface org.eclipse.higgins.idas.api.IHasMetadata
Throws:
org.eclipse.higgins.idas.api.IdASException
See Also:
IHasMetadata.getMetadataSet()

getMetadata

public org.eclipse.higgins.idas.api.IMetadata getMetadata(URI metadataID)
                                                   throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getMetadata in interface org.eclipse.higgins.idas.api.IHasMetadata
Throws:
org.eclipse.higgins.idas.api.IdASException

addMetadata

public org.eclipse.higgins.idas.api.IMetadata addMetadata(URI type)
                                                   throws org.eclipse.higgins.idas.api.IdASException,
                                                          org.eclipse.higgins.idas.api.InvalidTypeException
Specified by:
addMetadata in interface org.eclipse.higgins.idas.api.IHasMetadata
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.InvalidTypeException

addMetadata

public org.eclipse.higgins.idas.api.IMetadata addMetadata(org.eclipse.higgins.idas.api.IMetadata copyFrom)
                                                   throws org.eclipse.higgins.idas.api.IdASException
Specified by:
addMetadata in interface org.eclipse.higgins.idas.api.IHasMetadata
Throws:
org.eclipse.higgins.idas.api.IdASException

equals

public boolean equals(org.eclipse.higgins.idas.api.IHasMetadata metadataSet)
               throws org.eclipse.higgins.idas.api.IdASException
Specified by:
equals in interface org.eclipse.higgins.idas.api.IHasMetadata
Throws:
org.eclipse.higgins.idas.api.IdASException

updateNotification

public void updateNotification(AttributeValueNotification attrValueNotif)
                        throws org.eclipse.higgins.idas.api.IdASException
Specified by:
updateNotification in interface IAttributeValueContainer
Parameters:
attrValueNotif -
Throws:
org.eclipse.higgins.idas.api.IdASException

updateNotification

public void updateNotification(MetadataNotification metaNotif)
                        throws org.eclipse.higgins.idas.api.IdASException
Specified by:
updateNotification in interface IMetadataContainer
Parameters:
metaNotif -
Throws:
org.eclipse.higgins.idas.api.IdASException

setContainer

public void setContainer(IAttributeContainer container)

getContainer

public IAttributeContainer getContainer()

equals

public boolean equals(org.eclipse.higgins.idas.api.IAttribute attr)
               throws org.eclipse.higgins.idas.api.IdASException
Specified by:
equals in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException