Interface CmpPos

All Known Implementing Classes:
ItrPos, Pos

public interface CmpPos
Position checks.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if minimum and maximum expressions are identical.
    If possible, returns an optimized expression with inverted operands.
    boolean
    Checks if the positional range is deterministic.
    int
    test(long pos, QueryContext qc)
    Checks the current position.
  • Method Details

    • test

      int test(long pos, QueryContext qc) throws QueryException
      Checks the current position.
      • Returns 2 if the test is successful and remaining test can be skipped
      • Returns 1 if the test is successful
      • Returns 0 otherwise
      Should only be called if this is a simple() check.
      Parameters:
      pos - current position
      qc - query context
      Returns:
      result of check
      Throws:
      QueryException - query exception
    • simple

      boolean simple()
      Checks if the positional range is deterministic.
      Returns:
      result of check
    • exact

      boolean exact()
      Checks if minimum and maximum expressions are identical.
      Returns:
      result of check
    • invert

      Expr invert(CompileContext cc) throws QueryException
      If possible, returns an optimized expression with inverted operands.
      Parameters:
      cc - compilation context
      Returns:
      original or modified expression
      Throws:
      QueryException - query exception