org.apache.lucene.spatial.util

## Class ShapeValuesPredicate

- java.lang.Object
- - org.apache.lucene.spatial.util.ShapeValuesPredicate

- All Implemented Interfaces:
    SegmentCacheable

      public class ShapeValuesPredicate
      extends Object
      implements SegmentCacheable

  Compares a shape from a provided `ShapeValuesSource` with a given Shape and sees if it matches a given `SpatialOperation` (the predicate). Consumers should call `iterator(LeafReaderContext, DocIdSetIterator)` to obtain a `TwoPhaseIterator` over a particular `DocIdSetIterator`. The initial DocIdSetIterator will be used as the approximation, and the `SpatialOperation` comparison will only be performed in `TwoPhaseIterator.matches()`
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ShapeValuesPredicate(ShapeValuesSource shapeValuesource, SpatialOperation op, org.locationtech.spatial4j.shape.Shape queryShape)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `int` | `hashCode()`
    `boolean` | `isCacheable(LeafReaderContext ctx)`
    `TwoPhaseIterator` | `iterator(LeafReaderContext ctx, DocIdSetIterator approximation)`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ShapeValuesPredicate

          public ShapeValuesPredicate(ShapeValuesSource shapeValuesource,
                                      SpatialOperation op,
                                      org.locationtech.spatial4j.shape.Shape queryShape)

      Parameters:
        `shapeValuesource` - Must yield `Shape` instances from its objectVal(doc). If null then the result is false. This is the left-hand (indexed) side.
        `op` - the predicate
        `queryShape` - The shape on the right-hand (query) side.

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### iterator

          public TwoPhaseIterator iterator(LeafReaderContext ctx,
                                           DocIdSetIterator approximation)
                                    throws IOException

      Throws:
        `IOException`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### isCacheable

          public boolean isCacheable(LeafReaderContext ctx)

      Specified by:
        `isCacheable` in interface `SegmentCacheable`

Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.