|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
As defined at (TODO (Doc): add reference), This interface represents an attribute of a DigitalSubject.
An attribute is a typed set of values.
When the attribute's model dictates that it is single-valued isSingleValued()
then this object may be cast to an ISingleValuedAttribute
| Method Summary | |
|---|---|
IComplexAttrValue |
addComplexValue(URI type)
Creates a new complex value for this attribute. |
ISimpleAttrValue |
addSimpleValue(URI type,
Object data)
Creates a new simple value for this attribute. |
IAttributeValue |
addValue(IAttributeValue copyFrom)
Creates a new value for this attribute by copying the passed IAttributeValue
Note: This operation is only applied to any backing data store after
IContext.applyUpdates() is called. |
IAttributeValue |
addValue(URI type)
Creates a new value for this attribute. |
boolean |
equals(IAttribute attr)
Returns true if the passed attribute is equal to this one. |
URI |
getAttrID()
Returns the type (AttributeID) of this attribute as a URI. |
IAttributeModel |
getModel()
Returns a model of this type of attribute as it defined in the context's schema. |
Iterator |
getValues()
Returns all values for this attribute. |
boolean |
isSingleValued()
Convenience method which returns true when the model for this attribute dictates that only a single value my exist. |
void |
remove()
Removes this attribute from its container Note: This operation is only applied to any backing data store after IContext.applyUpdates() is called. |
| Methods inherited from interface org.eclipse.higgins.idas.api.IHasMetadata |
|---|
addMetadata, addMetadata, equals, getMetadata, getMetadataSet |
| Method Detail |
public URI getAttrID()
throws IdASException
URI.From this URI, a consumer should be able to derive some kind of human-readable name (such as "age", "title", "employeeNumber", etc.).
A consumer might also be able to determine from this URI, the type or range of types of object(s) returned from ISingleValuedAttribute.getValue() and getValues().
These determinations may be made either by examining parts of the URI itself, or dereferencing it (or parts) to other sources of information.
IdASException
public Iterator getValues()
throws IdASException
IAttributeValues
IdASException
public IAttributeValue addValue(URI type)
throws IdASException,
InvalidTypeException
addSimpleValue(URI, Object)
or addComplexValue(URI)
This call is typically followed by a call to IAttributeValue.isSimple()
on the returned IAttributeValue.
When found to be an ISimpleAttrValue, ITypedValue.setData(Object) is typically
called on the returned IAttributeValue (cast as an ISimpleAttrValue).
When found to be an IComplexAttrValue, one typically calls
IHasAttributes.addAttribute(URI) on the returned IAttributeValue
(cast as an IComplexAttrValue or IHasAttributes).
Note: This operation is only applied to any backing data store after
IContext.applyUpdates() is called.
type - The URI specifying the type of Value being created
{@link - IdASException}
{@link - InvalidTypeException} when the type is invalid
IdASException
InvalidTypeException
public IAttributeValue addValue(IAttributeValue copyFrom)
throws IdASException
IAttributeValue
Note: This operation is only applied to any backing data store after
IContext.applyUpdates() is called.
copyFrom - The IAttributeValue from which data is copied to create the
returned IAttributeValue
{@link - IdASException}
IdASException
public ISimpleAttrValue addSimpleValue(URI type,
Object data)
throws IdASException,
InvalidTypeException
IContext.applyUpdates() is called.
type - The URI specifying the type of Value being createddata - The data of the attribute value
{@link - IdASException}
{@link - InvalidTypeException} when the type is invalid
IdASException
InvalidTypeException
public IComplexAttrValue addComplexValue(URI type)
throws IdASException,
InvalidTypeException
IHasAttributes.addAttribute(java.net.URI) on the returned IComplexAttrValue.
Note: This operation is only applied to any backing data store after
IContext.applyUpdates() is called.
type - The URI specifying the type of complex value being created
{@link - IdASException}
{@link - InvalidTypeException} when the type is invalid
IdASException
InvalidTypeException
public void remove()
throws IdASException
IContext.applyUpdates() is called.
{@link - IdASException}
IdASException
public IAttributeModel getModel()
throws IdASException
IdASException
public boolean isSingleValued()
throws IdASException
(myAttribute.getModel().getMaxCardinality() == 1)
ISingleValuedAttribute
IdASException
public boolean equals(IAttribute attr)
throws IdASException
attr - the attribute to be compared to this one
IdASException
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||