Class ViewExpressionComparisons


  • public class ViewExpressionComparisons
    extends Object
    A data structure that represents a ViewExpression with a ComparisonRange on some of the Elements in its sort order.

    A ViewExpressionComparisons is an analogue of a ScanComparisons that maintains information about which elements in the sort order of a ViewExpression correspond to each comparison. It maintains a list of ComparisonRanges for each of the elements. The matchWith(ElementPredicate) method can then take a ElementPredicate and try to add it to the existing comparisons.

    The ViewExpressionComparisons encapsulates the core logic of marking parts of a complex key expression as satisfied by various types of Comparisons.Comparisons and attempting to match more comparisons to the remaining parts of the expression. This includes the "virtual" Comparisons.SortComparison which is used only to represent requested sort orders for index planning.

    While this sounds a lot like a whole query planner, the scope of a ViewExpressionComparisons is intentionally very limited. In particular, it supports matching with an ElementPredicate rather than a more general QueryPredicate As a result, the logic for handling Boolean operations and other complexities does not belong in ViewExpressionComparisons.