Class TupleExprs


  • public class TupleExprs
    extends Object
    Utility methods for TupleExpr objects.
    Author:
    Jeen Broekstra
    • Constructor Detail

      • TupleExprs

        public TupleExprs()
    • Method Detail

      • containsSubquery

        public static boolean containsSubquery​(TupleExpr t)
        Verifies if the supplied TupleExpr contains a Projection with the subquery flag set to true (default). If the supplied TupleExpr is a Join or contains a Join, projections inside that Join's arguments will not be taken into account.
        Parameters:
        t - a tuple expression.
        Returns:
        true if the TupleExpr contains a subquery projection (outside of a Join), false otherwise.
      • containsExtension

        public static boolean containsExtension​(TupleExpr t)
        Verifies if the supplied TupleExpr contains a Extension. If the supplied TupleExpr is a Join or contains a Join, a Service clause or a subquery element, extensions inside that element's argument will not be taken into account.
        Parameters:
        t - a tuple expression.
        Returns:
        true if the TupleExpr contains an Extension (outside of a Join, Service clause, or subquery), false otherwise.
      • isVariableScopeChange

        public static boolean isVariableScopeChange​(TupleExpr expr)
        Verifies if the supplied TupleExpr represents a variable scope change.
        Parameters:
        expr - a TupleExpr
        Returns:
        true if the TupleExpr implements VariableScopeChange and has its scope change flag set to true, false otherwise.
      • containsProjection

        @Deprecated
        public static boolean containsProjection​(TupleExpr t)
        Deprecated.
        since 2.0. Use containsSubquery(TupleExpr) instead.
        Verifies if the supplied TupleExpr contains a Projection. If the supplied TupleExpr is a Join or contains a Join, projections inside that Join's arguments will not be taken into account.
        Parameters:
        t - a tuple expression.
        Returns:
        true if the TupleExpr contains a projection (outside of a Join), false otherwise.
      • getChildren

        public static List<TupleExpr> getChildren​(TupleExpr t)
        Returns TupleExpr children of the given node.
        Parameters:
        t - a tuple expression.
        Returns:
        a list of TupleExpr children.
      • createConstVar

        public static Var createConstVar​(Value value)
        Creates an (anonymous) Var representing a constant value. The variable name will be derived from the actual value to guarantee uniqueness.
        Parameters:
        value -
        Returns:
        an (anonymous) Var representing a constant value.
      • getConstVarName

        public static String getConstVarName​(Value value)
      • isFilterExistsFunction

        public static boolean isFilterExistsFunction​(TupleExpr expr)
        Verifies if the supplied expression is a FILTER (NOT) EXISTS operation
        Parameters:
        expr - a tuple expression
        Returns:
        true if the supplied expression is a FILTER (NOT) EXISTS operation, false otherwise.