Interface IModel
-
- All Known Implementing Classes:
Model
public interface IModelRepresents a variability model.- Author:
- Holger Eichelberger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IConstraintcreateConstraint(java.lang.String constraint)Creates a constraint from the given string.java.lang.StringgetName()Returns the name of the model.java.lang.StringgetType(int index)Returns a particular known type.intgetTypesCount()Returns the number of types known to this model.IDecisionVariablegetVariable(int index)Returns a particular decision variable.IDecisionVariablegetVariable(java.lang.String name)Returns a decision variable by it's (valid IVML) name.intgetVariablesCount()Returns the number of decision variables stored in this model.java.lang.StringgetVersion()Returns the name of the version.java.lang.StringtoString()Returns the textual representation of this model.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Returns the name of the model.- Returns:
- the name of the model
-
getVersion
java.lang.String getVersion()
Returns the name of the version.- Returns:
- the name of the version (may be null)
-
getVariablesCount
int getVariablesCount()
Returns the number of decision variables stored in this model.- Returns:
- the number of decision variables
-
getVariable
IDecisionVariable getVariable(int index)
Returns a particular decision variable.- Parameters:
index- the 0-based index of the variable to be returned- Returns:
- the specified variable
- Throws:
java.lang.IndexOutOfBoundsException- in case thatindex<0 || index>={getVariablesCount()}
-
getVariable
IDecisionVariable getVariable(java.lang.String name) throws ModelException
Returns a decision variable by it's (valid IVML) name.- Parameters:
name- the name of the variable- Returns:
- the decision variable (or null if not found)
- Throws:
ModelException- in case of any semantic problem
-
getTypesCount
int getTypesCount()
Returns the number of types known to this model.- Returns:
- the number of types
-
getType
java.lang.String getType(int index)
Returns a particular known type.- Parameters:
index- the 0-based index of the type to be returned- Returns:
- the specified type
- Throws:
java.lang.IndexOutOfBoundsException- in case thatindex<0 || index>={getTypesCount()}
-
createConstraint
IConstraint createConstraint(java.lang.String constraint) throws ModelException
Creates a constraint from the given string. This method does not modify the model.- Parameters:
constraint- the string to be turned into a constraint (in IVML notation)- Returns:
- the constraint
- Throws:
ModelException- in case of syntactical or semantical problems
-
toString
java.lang.String toString()
Returns the textual representation of this model.- Overrides:
toStringin classjava.lang.Object- Returns:
- the textual representation in IVML syntax
-
-