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.
 int getMinCardinality()
          Returns the minimum number of values required by occurrences of this attribute.
 IAttributeValueModel getValueModel()
          Deprecated. Attribute values can all have different value models now
 boolean isDirect()
          Deprecated. Don't know what this is
 
Methods inherited from interface org.eclipse.higgins.idas.api.model.IModel
getDisplayData, getType
 

Method Detail

getValueModel

public IAttributeValueModel getValueModel()
                                   throws IdASException
Deprecated. Attribute values can all have different value models now

Returns value model of represented type of attribute as it defined in the context's ontology model.

Throws:
IdASException

isDirect

public boolean isDirect()
                 throws IdASException
Deprecated. Don't know what this is

TODO: What is this for?

Throws:
IdASException

getMaxCardinality

public int getMaxCardinality()
                      throws IdASException
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.
Throws:
IdASException
See Also:
getMaxCardinality()

getMinCardinality

public int getMinCardinality()
                      throws IdASException
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.
Throws:
IdASException
See Also:
getMinCardinality()