org.eclipse.higgins.idas.api.model
Interface IAttributeModel

All Superinterfaces:
IModel

public interface IAttributeModel
extends IModel

Represents a model of attribute as it defined in the context's ontology model.

The type returned by IModel.getType() could be used in IHasAttributes.addAttribute(URI) to create an IAttribute of represented type.

See Also:
IAttribute

Method Summary
 int getMaxCardinality()
          Returns the maximum number of values required by occurrences of this attribute.
 IMetadataModel getMetadataModel(URI metadataType)
          Returns IMetadataModel for the specified metadata ID
 Iterator getMetadataModels()
          Returns IMetadataModels for the metadata elements which are defined (allowed) in this attribute model.
 int getMinCardinality()
          Returns the minimum number of values required by occurrences of this attribute.
 IAttributeValueModel getValueModel()
          Returns value model of represented type of attribute as it defined in the context's ontology model.
 boolean isDirect()
          TODO: What is this for?
 
Methods inherited from interface org.eclipse.higgins.idas.api.model.IModel
getDisplayData, getType
 

Method Detail

getValueModel

public IAttributeValueModel getValueModel()
Returns value model of represented type of attribute as it defined in the context's ontology model.


isDirect

public boolean isDirect()
TODO: What is this for?


getMaxCardinality

public int getMaxCardinality()
Returns the maximum number of values required by occurrences of this attribute. When this IAttributeModel is returned from IEntityModel.getAttributeModel(URI) or IEntityModel.getAttributeModels(), the maximum cardinality refers to occurrences of this attribute in relationship to that Entity type. When this IAttributeModel is returned from IContextModel.getModel(URI), the minimum cardinality refers to the default behavior of occurrences of this attribute, but the cardinality may be overridden as the attribute is applied to any given Entity type. Therefore, it's best to query an attribute's cardinality as it applies to a particular Entity.

Returns:
A positive number indicates the maximum number of values that may be present. The value -1 indicates that there is no limit to the number of values that may be present. The value 0 has no meaning and should not be returned.
See Also:
getMaxCardinality()

getMinCardinality

public int getMinCardinality()
Returns the minimum number of values required by occurrences of this attribute. When this IAttributeModel is returned from IEntityModel.getAttributeModel(URI) or IEntityModel.getAttributeModels(), the minimum cardinality refers to occurrences of this attribute in relationship to that Entity type. When this IAttributeModel is returned from IContextModel.getModel(URI), the minimum cardinality refers to the default behavior of occurrences of this attribute, but the cardinality may be overridden as the attribute is applied to any given Entity type. Therefore, it's best to query an attribute's cardinality as it applies to a particular Entity.

Returns:
0 if no values are required to be present. This of course also means the attribute itself is optional. A positive number indicates the minimum number of values that must be present. The value -1 has no meaning and should not be returned.
See Also:
getMinCardinality()

getMetadataModels

public Iterator getMetadataModels()
Returns IMetadataModels for the metadata elements which are defined (allowed) in this attribute model.

Returns:
Iterator of IMetadataModel

getMetadataModel

public IMetadataModel getMetadataModel(URI metadataType)
Returns IMetadataModel for the specified metadata ID

Parameters:
metadataType - the type of metadata.
Returns:
metadata's model of requested type or null if the specified metadataID is not defined or not valid for this attribute model.