Interface ModelConverter
-
- All Known Implementing Classes:
IndexBasedModelConverter
public interface ModelConverterAn interface for classes which can convert anInputParameterModelto aCompleteTestModel. Additionally, all sub-resources like parameters, combinations, and constraints can be converted.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CombinationconvertCombination(int[] combination)Converts a combinations represented by an integer array into aCombinationobject with the corresponding parameters and values.int[]convertCombination(Combination combination)Converts aCombinationobject to an integer array representation with the corresponding value number.ConstraintconvertConstraint(TupleList constraint)Converts aTupleListobject into aConstraintrepresentation which is equal.TupleListconvertConstraint(Constraint constraint)Converts aConstraintobject into aTupleListrepresentation which is equal.ParameterconvertParameter(int parameter)Converts an integer representation back to aParameterobject.intconvertParameter(Parameter parameter)Converts aParameterobject into an equivalent integer representation.ValueconvertValue(int parameter, int value)Converts the integer representation of a value into aValueobject.intconvertValue(Parameter parameter, Value value)Converts aValueto an integer representation.CompleteTestModelgetConvertedModel()InputParameterModelgetModel()
-
-
-
Method Detail
-
getModel
InputParameterModel getModel()
- Returns:
- the original testModel which is converted by this
ModelConverter
-
getConvertedModel
CompleteTestModel getConvertedModel()
- Returns:
- the conversion of the original testModel (
getModel())
-
convertCombination
int[] convertCombination(Combination combination)
Converts aCombinationobject to an integer array representation with the corresponding value number. If the array returned by this method is given intoconvertCombination(int[]), aCombinationequal to the original one should be returned.- Parameters:
combination- the combination to be converted. Must not benull- Returns:
- the corresponding integer array to that it matches the testModel conversion
-
convertCombination
Combination convertCombination(int[] combination)
Converts a combinations represented by an integer array into aCombinationobject with the corresponding parameters and values.- Parameters:
combination- the combination to be converted. Must not benull- Returns:
- the corresponding
Combinationso that it matches the testModel conversion
-
convertConstraint
TupleList convertConstraint(Constraint constraint)
Converts aConstraintobject into aTupleListrepresentation which is equal. If theTupleListreturned by this method is given toconvertConstraint(TupleList), the original constraint will be returned.- Parameters:
constraint- the constraint to convert. Needs to be one in the original testModel, otherwise success of this method is not guaranteed. Must not benull- Returns:
- the corresponding
TupleListrepresentation so that it matches the testModel conversion
-
convertConstraint
Constraint convertConstraint(TupleList constraint)
Converts aTupleListobject into aConstraintrepresentation which is equal.- Parameters:
constraint- the constraint to convert. Needs to be one in the original testModel, otherwise success of this method is not guaranteed. Must not benull- Returns:
- the corresponding
MethodBasedConstraintrepresentation so that it matches the testModel conversion
-
convertParameter
int convertParameter(Parameter parameter)
Converts aParameterobject into an equivalent integer representation. If the integer returned by this method is given toconvertParameter(int), the original parameter is returned.- Parameters:
parameter- the parameter to convert. Needs to be in the original testModel, otherwise success of this method is not guaranteed. Must not benull- Returns:
- the corresponding integer representation so that it matches the testModel conversion
-
convertParameter
Parameter convertParameter(int parameter)
Converts an integer representation back to aParameterobject.- Parameters:
parameter- the parameter to convert. Needs to be in the original testModel, otherwise success of this method is not guaranteed. Must not be negative- Returns:
- the corresponding
Parameterrepresentation so that it matches the testModel conversion
-
convertValue
int convertValue(Parameter parameter, Value value)
Converts aValueto an integer representation. As values are only unique in their correspondingParameters, the parameter is needed as well. It can be converted usingconvertParameter(Parameter). If the converted value and parameter are given toconvertValue(int, int), the original value is returned.- Parameters:
parameter- the parameter in which the value is locatedvalue- the value to convert- Returns:
- the corresponding integer representation so that it matches the testModel conversion
-
convertValue
Value convertValue(int parameter, int value)
Converts the integer representation of a value into aValueobject. The parameter is needed since values are only unique in the context of their parameters. The parameter can be converted withconvertParameter(int).- Parameters:
parameter- the parameter in which the value is locatedvalue- the value to convert- Returns:
- the corresponding
Valuerepresentation so that it matches the testModel conversion
-
-