Esempio n. 1
0
        /// <summary>
        /// Returns a <see cref="Filter"/> that should be used with <see cref="FilteredQuery.QUERY_FIRST_FILTER_STRATEGY"/>.
        /// Use in another manner is likely to result in an <see cref="NotSupportedException"/>
        /// to prevent misuse because the filter can't efficiently work via iteration.
        /// </summary>
        public override Filter MakeFilter(SpatialArgs args)
        {
            ValueSource shapeValueSource = MakeShapeValueSource();
            ShapePredicateValueSource predicateValueSource = new ShapePredicateValueSource(
                shapeValueSource, args.Operation, args.Shape);

            return(new PredicateValueSourceFilter(predicateValueSource));
        }
Esempio n. 2
0
        /// <summary>
        /// Returns a <see cref="Filter"/> that should be used with <see cref="FilteredQuery.QUERY_FIRST_FILTER_STRATEGY"/>.
        /// Use in another manner is likely to result in an <see cref="NotSupportedException"/>
        /// to prevent misuse because the filter can't efficiently work via iteration.
        /// </summary>
        public override Filter MakeFilter(SpatialArgs args)
        {
            // LUCENENET specific - added guard clause
            if (args is null)
            {
                throw new ArgumentNullException(nameof(args));
            }

            ValueSource shapeValueSource = MakeShapeValueSource();
            ShapePredicateValueSource predicateValueSource = new ShapePredicateValueSource(
                shapeValueSource, args.Operation, args.Shape);

            return(new PredicateValueSourceFilter(predicateValueSource));
        }