Enum Flag

  • All Implemented Interfaces:
    Serializable, Comparable<Flag>

    public enum Flag
    extends Enum<Flag>
    Expression properties that influence query compilation.
    Author:
    BaseX Team 2005-22, BSD License, Christian Gruen
    • Enum Constant Detail

      • CNS

        public static final Flag CNS
        Node creation. No relocation of expressions that would change number of node constructions Example: node constructor.
      • CTX

        public static final Flag CTX
        Context dependency. Checked to prevent relocations of expressions to different context. Example: context item (.).
      • NDT

        public static final Flag NDT
        Non-deterministic code. Cannot be relocated, pre-evaluated or optimized away. Examples: random:double(), file:write().
      • POS

        public static final Flag POS
        Positional access. Prevents simple iterative evaluation. Each expression that contains this flag must also contain CTX. Examples: position(), last().
      • UPD

        public static final Flag UPD
        Performs updates. Checked to detect if an expression is updating or not, or if code can be optimized away when using MainOptions.MIXUPDATES. All updating expressions are non-deterministic. Example: delete node.
      • HOF

        public static final Flag HOF
        Function invocation. Used to suppress pre-evaluation of built-in functions with functions arguments. Example: fn:fold-left.
      • FCS

        public static final Flag FCS
        Checked to detect if an expression modifies the query focus. Examples: simple map, filter, path, transform with.
    • Method Detail

      • values

        public static Flag[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Flag c : Flag.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Flag valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • remove

        public Flag[] remove​(Flag[] flags)
        Removes this flag from the specified array.
        Parameters:
        flags - flags
        Returns:
        new array
      • in

        public boolean in​(Flag[] flags)
        Checks this flag is contained in the specified array.
        Parameters:
        flags - flags
        Returns:
        result of check