Class AbstractIndexBasedConstraintConverter
- java.lang.Object
-
- de.rwth.swc.coffee4j.engine.converter.constraints.AbstractIndexBasedConstraintConverter
-
- All Implemented Interfaces:
IndexBasedConstraintConverter
- Direct Known Subclasses:
SimpleCartesianProductConstraintConverter,TupleBasedConstraintConverter
public abstract class AbstractIndexBasedConstraintConverter extends Object implements IndexBasedConstraintConverter
Abstract class providing functionality and fields commonly used by all different types of converters.
-
-
Constructor Summary
Constructors Constructor Description AbstractIndexBasedConstraintConverter(List<Parameter> parameters)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description TupleListconvert(Constraint constraint, int lastId)Converts the constraint to aTupleListby using the index based schema explained inModelConverter.List<TupleList>convert(List<Constraint> constraints, int lastId)Converts all constraints toTupleLists by using the index based schema explained inModelConverter.protected abstract TupleListconvertedConstraint(Constraint constraint, it.unimi.dsi.fastutil.objects.Object2IntMap<String> parameterIdMap, it.unimi.dsi.fastutil.ints.Int2ObjectMap<Parameter> idToParameterMap, int id)template method implemented by sub-classes to convert the givenConstraintinto aTupleList.
-
-
-
Method Detail
-
convert
public List<TupleList> convert(List<Constraint> constraints, int lastId)
Description copied from interface:IndexBasedConstraintConverterConverts all constraints toTupleLists by using the index based schema explained inModelConverter. The constraints need to be converted in order.- Specified by:
convertin interfaceIndexBasedConstraintConverter- Parameters:
constraints- allConstraints which need to be converted. Must not benullbut can be emptylastId- last id that has been assigned.- Returns:
- the converted constraints in the same order as the given constraints
-
convert
public TupleList convert(Constraint constraint, int lastId)
Description copied from interface:IndexBasedConstraintConverterConverts the constraint to aTupleListby using the index based schema explained inModelConverter.- Specified by:
convertin interfaceIndexBasedConstraintConverter- Parameters:
constraint-Constraintthat needs to be converted. Must not benull.lastId- last id that has been assigned.- Returns:
- the converted
Constraint.
-
convertedConstraint
protected abstract TupleList convertedConstraint(Constraint constraint, it.unimi.dsi.fastutil.objects.Object2IntMap<String> parameterIdMap, it.unimi.dsi.fastutil.ints.Int2ObjectMap<Parameter> idToParameterMap, int id)
template method implemented by sub-classes to convert the givenConstraintinto aTupleList.- Parameters:
constraint- constraint to be converted.parameterIdMap- map from parameter name to Id.idToParameterMap- map from Id toParameter.id- id to assign.- Returns:
- converted constraint.
-
-