Class NestedPlan
- java.lang.Object
-
- org.aksw.limes.core.execution.planning.plan.Plan
-
- org.aksw.limes.core.execution.planning.plan.NestedPlan
-
public class NestedPlan extends Plan
Implements the nested plan of a link specification. Note that the subPlans fields is set to null by the instructor. Before adding a subplan for the first time, the subPlans field must be initiated.- Version:
- 1.0
- Author:
- Axel-C. Ngonga Ngomo (ngonga@informatik.uni-leipzig.de), Kleanthi Georgala (georgala@informatik.uni-leipzig.de)
-
-
Field Summary
-
Fields inherited from class org.aksw.limes.core.execution.planning.plan.Plan
instructionList, mappingSize, runtimeCost, selectivity
-
-
Constructor Summary
Constructors Constructor Description NestedPlan()Constructor of the NestedPlan class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSubplan(NestedPlan subplan)Adds a sub-Plan to the current list of sub-plans.NestedPlanclone()Returns a clone of the current plan.booleanequals(Object other)Compares the current plan with another plan, P.StringfinalPlan()Returns a string representation of current plan as a set of commands.List<String>getAllMeasures()Returns all the metric expressions of the current plan.booleangetExecutionStatus()Returns the execution status of the plan.InstructiongetFilteringInstruction()Returns the filtering Instruction of the plan.List<Instruction>getInstructionList()Returns the list of instructions contained in a instructionList.Instruction.CommandgetOperator()Returns the operator of the plan.List<NestedPlan>getSubPlans()Returns the set of sub-plans of the current plan.StringgetThreshold()Returns the threshold of the current plan.booleanisAtomic()Checks whether the current plan is atomic or not.booleanisEmpty()Checks if the plan is empty.voidsetExecutionStatus(boolean executionStatus)Updates the execution status of the plan.voidsetFilteringInstruction(Instruction filteringInstruction)Sets the filtering Instruction of the plan.voidsetOperator(Instruction.Command operator)Sets the operator of the plan.voidsetSubPlans(List<NestedPlan> subPlans)Sets the sub-plans of the plan.intsize()Returns the size of the current plan.StringtoString()String representation of the current plan.-
Methods inherited from class org.aksw.limes.core.execution.planning.plan.Plan
addInstruction, getMappingSize, getRuntimeCost, getSelectivity, hashCode, removeInstruction, removeInstruction, setInstructionList, setMappingSize, setRuntimeCost, setSelectivity
-
-
-
-
Method Detail
-
getSubPlans
public List<NestedPlan> getSubPlans()
Returns the set of sub-plans of the current plan.- Returns:
- the current sub-plans
-
setSubPlans
public void setSubPlans(List<NestedPlan> subPlans)
Sets the sub-plans of the plan.- Parameters:
subPlans- The sub-plans to set
-
getOperator
public Instruction.Command getOperator()
Returns the operator of the plan.- Returns:
- the operator of the plan
-
setOperator
public void setOperator(Instruction.Command operator)
Sets the operator of the plan.- Parameters:
operator- The operator to set
-
getFilteringInstruction
public Instruction getFilteringInstruction()
Returns the filtering Instruction of the plan.- Returns:
- the filtering instruction of the plan
-
setFilteringInstruction
public void setFilteringInstruction(Instruction filteringInstruction)
Sets the filtering Instruction of the plan.- Parameters:
filteringInstruction- The filtering instruction to set
-
getExecutionStatus
public boolean getExecutionStatus()
Returns the execution status of the plan.- Returns:
- true if the current plan has been executed or false otherwise
-
setExecutionStatus
public void setExecutionStatus(boolean executionStatus)
Updates the execution status of the plan. If the plan has just been executed then it changes the value from false to true.- Parameters:
executionStatus- true if the plan has just been executed or false otherwise.
-
isEmpty
public boolean isEmpty()
Checks if the plan is empty. Returns true if and only if the instruction list is empty and both the sub-plans and the filtering instructions are null.
-
isAtomic
public boolean isAtomic()
Checks whether the current plan is atomic or not. A plan is atomic if its sub-plans are null or if the existing sub-plans are empty.- Returns:
- true if the plan is atomic and false otherwise
-
getInstructionList
public List<Instruction> getInstructionList()
Returns the list of instructions contained in a instructionList. If the plan is not atomic, then the functions returns all the instructions of each atomic nested plan included in the current plan.- Specified by:
getInstructionListin interfaceIPlan- Overrides:
getInstructionListin classPlan- Returns:
- a clone of the list of instructions of the current plan
-
size
public int size()
Returns the size of the current plan. The size of a plan is equal to the size of its instruction list.
-
clone
public NestedPlan clone()
Returns a clone of the current plan. Each non-primitive field of the current plan is cloned by invoking the clone function of the corresponding class.
-
addSubplan
public void addSubplan(NestedPlan subplan)
Adds a sub-Plan to the current list of sub-plans. If there is no list one will be created.- Parameters:
subplan- The sub-plan to be added
-
getAllMeasures
public List<String> getAllMeasures()
Returns all the metric expressions of the current plan.- Returns:
- List of all metric expressions
-
toString
public String toString()
String representation of the current plan.
-
getThreshold
public String getThreshold()
Returns the threshold of the current plan. If the filtering instruction is not null, then it returns the threshold of the filtering instruction and 0 otherwise.- Returns:
- the threshold as string
-
finalPlan
public String finalPlan()
Returns a string representation of current plan as a set of commands.- Returns:
- the current plan as a set of commands
-
equals
public boolean equals(Object other)
Compares the current plan with another plan, P. If P is null then it returns false. If both plans are atomic, then the functions returns true if they have the same instruction list. If both plans are complex, then the function checks if each field of the current plan is equal to the corresponding field of P. If one of the plans is atomic and the other is not, then it returns false.
-
-