org.eclipse.higgins.idas.impl
Class BasicAttributeSet

java.lang.Object
  extended by org.eclipse.higgins.idas.impl.BasicAttributeSet
All Implemented Interfaces:
IHasAttributes
Direct Known Subclasses:
AbstractComplexValue

public class BasicAttributeSet
extends java.lang.Object
implements IHasAttributes

Basic implementation of IHasAttributes. This class uses a HashMap of URI and IAttribute to hold the attributes.


Constructor Summary
BasicAttributeSet()
           
BasicAttributeSet(java.lang.Iterable<IAttribute> attrs)
           
 
Method Summary
 void addAttribute(IAttribute attribute)
           
 IAttribute createAttribute(java.net.URI type, IPropertyValue value)
          Creates and adds an attribute for this object.
 IAttribute createAttribute(java.net.URI type, java.lang.Iterable<IPropertyValue> values)
          Creates and adds an attribute for this object.
 IAttribute getAttribute(java.net.URI attrID)
          Return specified attribute of this object
 java.lang.Iterable<IAttribute> getAttributes()
          Return all attributes of this object
 void removeAttribute(IAttribute attribute)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicAttributeSet

public BasicAttributeSet()

BasicAttributeSet

public BasicAttributeSet(java.lang.Iterable<IAttribute> attrs)
Method Detail

createAttribute

public IAttribute createAttribute(java.net.URI type,
                                  IPropertyValue value)
                           throws IdASException
Description copied from interface: IHasAttributes
Creates and adds an attribute for this object.

Specified by:
createAttribute in interface IHasAttributes
Parameters:
type - The attribute's type.
value - The attribute's value.
Returns:
The resulting Attribute.
Throws:
IdASException

createAttribute

public IAttribute createAttribute(java.net.URI type,
                                  java.lang.Iterable<IPropertyValue> values)
                           throws IdASException
Description copied from interface: IHasAttributes
Creates and adds an attribute for this object.

Specified by:
createAttribute in interface IHasAttributes
Parameters:
type - The attribute's type.
values - The attribute's values.
Returns:
The resulting Attribute.
Throws:
IdASException

addAttribute

public void addAttribute(IAttribute attribute)
                  throws IdASException
Specified by:
addAttribute in interface IHasAttributes
Throws:
IdASException

removeAttribute

public void removeAttribute(IAttribute attribute)
                     throws IdASException
Specified by:
removeAttribute in interface IHasAttributes
Throws:
IdASException

getAttributes

public java.lang.Iterable<IAttribute> getAttributes()
                                             throws IdASException
Description copied from interface: IHasAttributes
Return all attributes of this object

Specified by:
getAttributes in interface IHasAttributes
Returns:
An Iterable object of IAttributes.
Throws:
IdASException

getAttribute

public IAttribute getAttribute(java.net.URI attrID)
                        throws IdASException
Description copied from interface: IHasAttributes
Return specified attribute of this object

Specified by:
getAttribute in interface IHasAttributes
Parameters:
attrID - The identifier of the attribute to be returned.
Returns:
An IAttribute or null if none exits.
Throws:
IdASException