Package net.ssehub.easy.varModel.model
Class PartialEvaluationBlock
java.lang.Object
net.ssehub.easy.varModel.model.ModelElement
net.ssehub.easy.varModel.model.ContainableModelElement
net.ssehub.easy.varModel.model.EvaluationBlock
net.ssehub.easy.varModel.model.PartialEvaluationBlock
- All Implemented Interfaces:
IDatatypeVisitable,IModelElement
Maintains partial evaluable elements.
- Author:
- Marcel Lueder, Holger Eichelberger
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IPartialEvaluable[]private List<ContainableModelElement> private PartialEvaluationBlock[] -
Constructor Summary
ConstructorsConstructorDescriptionPartialEvaluationBlock(String name, IModelElement parent) Constructor for the partial evaluation block.PartialEvaluationBlock(String name, IPartialEvaluable[] elements, IModelElement parent) Constructor for the partial evaluation block.PartialEvaluationBlock(String name, IPartialEvaluable[] elements, PartialEvaluationBlock[] nested, IModelElement parent) Constructor for the partial evaluation block. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(IModelVisitor visitor) Accept method for the visitor.voidaddModelElement(ContainableModelElement element) Adds a model element in sequence.getEvaluable(int index) Returns the constraint specified byindex.intReturns the number of constraints.getModelElement(int index) Returns the specified model element.intReturns the number of model elements.getNested(int index) Returns the nested block specified byindex.intReturns the number of nested blocks.booleanisEmpty()Checks whether the evaluation block is empty.voidsetEvaluables(IPartialEvaluable[] elements) Changes the evaluables.voidsetNested(PartialEvaluationBlock[] nested) Changes the nested blocks.Methods inherited from class net.ssehub.easy.varModel.model.ContainableModelElement
accept, getNameSpace, getParent, getProject, getQualifiedName, getTopLevelParent, isTopLevel, setParentMethods inherited from class net.ssehub.easy.varModel.model.ModelElement
findAttribute, getComment, getName, getUniqueName, isTransparent, propagateAttribute, setComment, setName, toString
-
Field Details
-
elements
-
nested
-
modelElements
-
-
Constructor Details
-
PartialEvaluationBlock
Constructor for the partial evaluation block.- Parameters:
name- Name of the partial evaluation blockparent- the object, in which this specific one is embedded
-
PartialEvaluationBlock
Constructor for the partial evaluation block.- Parameters:
name- Name of the partial evaluation blockelements- the evaluable elementsparent- the object, in which this specific one is embedded
-
PartialEvaluationBlock
public PartialEvaluationBlock(String name, IPartialEvaluable[] elements, PartialEvaluationBlock[] nested, IModelElement parent) Constructor for the partial evaluation block.- Parameters:
name- Name of the partial evaluation blockelements- the evaluable elementsnested- nested evaluation blocks (may be null)parent- the object, in which this specific one is embedded
-
-
Method Details
-
isEmpty
public boolean isEmpty()Checks whether the evaluation block is empty.- Overrides:
isEmptyin classEvaluationBlock- Returns:
- true if empty
-
getEvaluable
Returns the constraint specified byindex.- Parameters:
index- a 0-based index specifying the evaluable to be returned- Returns:
- the specified evaluable
- Throws:
IndexOutOfBoundsException- ifindex<0 || index>=getEvaluableCount()
-
getEvaluableCount
public int getEvaluableCount()Returns the number of constraints.- Returns:
- the number of constraints
-
setEvaluables
Changes the evaluables. [required as consequence of parent elements]- Parameters:
elements- the new evaluables (may be null)
-
getNested
Returns the nested block specified byindex.- Parameters:
index- a 0-based index specifying the block to be returned- Returns:
- the specified nested block
- Throws:
IndexOutOfBoundsException- ifindex<0 || index>=getNestedCount()
-
getNestedCount
public int getNestedCount()Returns the number of nested blocks.- Returns:
- the number of nested blocks
-
setNested
Changes the nested blocks. [required as consequence of parent elements]- Parameters:
nested- the new nested blocks (may be null)
-
accept
Description copied from interface:IModelElementAccept method for the visitor.- Parameters:
visitor- The visitor, which should process this model element.
-
getModelElement
Returns the specified model element.- Parameters:
index- the 0-based index of the model element- Returns:
- the model-element
- Throws:
IndexOutOfBoundsException- ifindex < 0 || index >=getModelElementCount()
-
getModelElementCount
public int getModelElementCount()Returns the number of model elements.- Returns:
- the number of model elements
-
addModelElement
Adds a model element in sequence. Please note that this method refers to all contained model elements, i.e., decision variables and constraints and is intended to restore the input sequence correctly.- Parameters:
element- the model element
-