Class Plan

  • All Implemented Interfaces:
    IPlan, Clonable<IPlan>
    Direct Known Subclasses:
    NestedPlan

    public class Plan
    extends Object
    implements IPlan
    Implements the plan of a link specification. A plan consists of a set of instructions that are going to be executed sequentially or in parallel by an execution engine.
    Version:
    1.0
    Author:
    Axel-C. Ngonga Ngomo (ngonga@informatik.uni-leipzig.de), Kleanthi Georgala (georgala@informatik.uni-leipzig.de)
    • Field Detail

      • runtimeCost

        protected double runtimeCost
        The runtime of the plan.
      • mappingSize

        protected double mappingSize
        The size of returned mapping of the plan.
      • selectivity

        protected double selectivity
        The selectivity of the plan.
      • instructionList

        protected List<Instruction> instructionList
        The list of instructions of the plan.
    • Constructor Detail

      • Plan

        public Plan()
        Constructor of Plan class.
    • Method Detail

      • addInstruction

        public void addInstruction​(Instruction instruction)
        Adds an instruction to the instructionList. Each new instruction is added at the end of the list. If an instructions can not be added, a corresponding message is displayed.
        Specified by:
        addInstruction in interface IPlan
        Parameters:
        instruction - The Instruction to add
      • removeInstruction

        public void removeInstruction​(int index)
        Removes the i-th instruction from the instructionList. If the index is lower than 0 or higher than the size of the current list, the removal fails and a corresponding message is displayed.
        Specified by:
        removeInstruction in interface IPlan
        Parameters:
        index - Index of instruction to remove
      • removeInstruction

        public void removeInstruction​(Instruction instruction)
        Removes an instruction from a instructionList.
        Specified by:
        removeInstruction in interface IPlan
        Parameters:
        instruction - Instruction to remove
      • getInstructionList

        public List<Instruction> getInstructionList()
        Returns the list of instructions contained in a instructionList.
        Specified by:
        getInstructionList in interface IPlan
        Returns:
        List of instructions
      • setInstructionList

        public void setInstructionList​(List<Instruction> instructionList)
        Sets the instructionList of the plan.
        Parameters:
        instructionList - The instruction list to set
      • isEmpty

        public boolean isEmpty()
        Checks whether the instructionList of the current plan is empty.
        Returns:
        true if it is empty or false otherwise
      • equals

        public boolean equals​(Object other)
        Checks if two plans are equal. Two plans are equal if their instructions lists are the same.
        Overrides:
        equals in class Object
        Returns:
        true if they are equal or false otherwise
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • clone

        public Plan 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.
        Specified by:
        clone in interface Clonable<IPlan>
        Overrides:
        clone in class Object
        Returns:
        a clone 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.
        Returns:
        the size of the plan
      • getRuntimeCost

        public double getRuntimeCost()
        Returns the runtime cost of the current plan.
        Returns:
        the runtime of the current plan
      • setRuntimeCost

        public void setRuntimeCost​(double runtimeCost)
        Sets the runtime cost of the plan.
        Parameters:
        runtimeCost - The runtime cost to set
      • getMappingSize

        public double getMappingSize()
        Returns the mapping size of the plan.
        Returns:
        the mapping size of the current plan
      • setMappingSize

        public void setMappingSize​(double mappingSize)
        Sets the mapping size of the plan.
        Parameters:
        mappingSize - The mapping size to set
      • getSelectivity

        public double getSelectivity()
        Returns the selectivity of the plan.
        Returns:
        the selectivity of the current plan
      • setSelectivity

        public void setSelectivity​(double selectivity)
        Sets the selectivity of the plan.
        Parameters:
        selectivity - The selectivity value to set