|
||||||||||||
| 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 an Entity.
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 dataType)
Creates a new complex value for this attribute. |
ISimpleAttrValue |
addSimpleValue(URI dataType,
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 dataType)
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 attribute ID 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 may 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 identifier (such as "age", "title", "employeeNumber", etc.).
This attribute ID is used to distinguish this attribute from other attributes within a collection of attributes.
Note that IModel.getType() will return the same URI that this method returns.
The reason we use the term "AttrID" here is because from an attribute instance point of view, this is
the identifier which distinguishes this attribute from others. The reason it is referred to as a type
from the attribute's model point of view is because it's tied to the capabilities of the attribute.
IdASException
public Iterator getValues()
throws IdASException
IAttributeValues
IdASException
public IAttributeValue addValue(URI dataType)
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.
dataType - The URI specifying the data 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 dataType,
Object data)
throws IdASException,
InvalidTypeException
IContext.applyUpdates() is called.
dataType - 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 dataType)
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.
dataType - 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 | |||||||||||