Class LinkSpecification

    • Constructor Detail

      • LinkSpecification

        public LinkSpecification()
      • LinkSpecification

        public LinkSpecification​(String measure,
                                 double threshold)
        Creates a spec with a measure read inside
        Parameters:
        measure - String representation of the spec
        threshold - of the spec
    • Method Detail

      • getTreePath

        public String getTreePath()
      • setTreePath

        public void setTreePath​(String treePath)
      • setAtomicFilterExpression

        public void setAtomicFilterExpression​(String atomicMeasure,
                                              String prop1,
                                              String prop2)
      • addChild

        public void addChild​(LinkSpecification spec)
        Adds a child to the current node of the spec
        Parameters:
        spec - to be added
      • addDependency

        public void addDependency​(LinkSpecification spec)
        Adds a child to the current node of the spec
        Parameters:
        spec - to be added
      • removeDependency

        public void removeDependency​(LinkSpecification spec)
        Removes a dependency from the list of dependencies
        Parameters:
        spec - Input spec
      • hasDependencies

        public boolean hasDependencies()
        Checks whether a spec has dependencies
        Returns:
        true if the spec has dependencies, false otherwise
      • isEmpty

        public boolean isEmpty()
        Returns:
        True if the spec is empty, all false
      • isAtomic

        public boolean isAtomic()
        Returns:
        True if the spec is a leaf (has no children), else false
      • pathOfAtomic

        public void pathOfAtomic()
        Create the path of operators for each leaf spec
      • readSpec

        public void readSpec​(String spec,
                             double theta)
        Reads a spec expression into its canonical form Don't forget to optimize the filters by checking (if threshold_left and threshold_right grater than or equal to theta, then theta = 0)
        Parameters:
        spec - expression to read
        theta - Global threshold
      • getAllLeaves

        public List<LinkSpecification> getAllLeaves()
        Returns all leaves of the link spec
        Returns:
        List of atomic spec, i.e., all leaves of the link spec
      • size

        public int size()
        Returns size of the spec, i.e., 1 for atomic spec, 0 for empty spec and else 1 + sum of size of all children
        Returns:
        Size of the current spec
      • hashCode

        public int hashCode()
        Computes a hashCode for the current spec
        Overrides:
        hashCode in class Object
        Returns:
        Hash code
      • toString

        public String toString()
        Overrides:
        toString in class Object
        Returns:
        A string representation of the spec
      • getDepth

        public int getDepth()
      • toStringPretty

        public String toStringPretty()
      • toStringOneLine

        public String toStringOneLine()
        Returns:
        A string representation of the spec in a single line
      • isRoot

        public boolean isRoot()
        Checks whether the current node is the root of the whole spec
        Returns:
        True if root, else false
      • getMeasure

        public String getMeasure()
        Returns:
        the filter expression implemented in the spec
      • getShortendFilterExpression

        public String getShortendFilterExpression()
      • getFilterExpression

        public String getFilterExpression()
      • getAtomicMeasure

        public String getAtomicMeasure()
        Returns:
        the atomicMeasure
      • setAtomicMeasure

        public void setAtomicMeasure​(String atomicMeasure)
        Parameters:
        atomicMeasure - the atomicMeasure to set
      • containsRedundantProperties

        public boolean containsRedundantProperties()
        Checks of at least two leaves compare the same properties, possibly with different measures though.
        Returns:
        true if two leaves compare the same properties, possibly with different measures
      • getThreshold

        public double getThreshold()
      • setThreshold

        public void setThreshold​(double threshold)
      • setOperator

        public void setOperator​(LogicOperator operator)
      • getFullExpression

        public String getFullExpression()
      • setFullExpression

        public void setFullExpression​(String fullExpression)
      • getProperty1

        public String getProperty1()
      • getProperty2

        public String getProperty2()
      • getQuality

        public double getQuality()
      • setQuality

        public void setQuality​(double quality)
      • getLowThreshold

        public double getLowThreshold()
      • setLowThreshold

        public void setLowThreshold​(double lowThreshold)