Interface IModel
public interface IModel
Represents a variability model.
- Author:
- Holger Eichelberger
-
Method Summary
Modifier and TypeMethodDescriptioncreateConstraint(String constraint) Creates a constraint from the given string.getName()Returns the name of the model.getType(int index) Returns a particular known type.intReturns the number of types known to this model.getVariable(int index) Returns a particular decision variable.getVariable(String name) Returns a decision variable by it's (valid IVML) name.intReturns the number of decision variables stored in this model.Returns the name of the version.toString()Returns the textual representation of this model.
-
Method Details
-
getName
String getName()Returns the name of the model.- Returns:
- the name of the model
-
getVersion
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
Returns a particular decision variable.- Parameters:
index- the 0-based index of the variable to be returned- Returns:
- the specified variable
- Throws:
IndexOutOfBoundsException- in case thatindex<0 || index>={getVariablesCount()}
-
getVariable
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
Returns a particular known type.- Parameters:
index- the 0-based index of the type to be returned- Returns:
- the specified type
- Throws:
IndexOutOfBoundsException- in case thatindex<0 || index>={getTypesCount()}
-
createConstraint
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
String toString()Returns the textual representation of this model.
-