org.apache.lucene.spatial.util

## Class ShapeFieldCache<T extends org.locationtech.spatial4j.shape.Shape>

- java.lang.Object
- - org.apache.lucene.spatial.util.ShapeFieldCache<T>

-     public class ShapeFieldCache<T extends org.locationtech.spatial4j.shape.Shape>
      extends Object

  Bounded Cache of Shapes associated with docIds. Note, multiple Shapes can be associated with a given docId.

  WARNING: This class holds the data in an extremely inefficient manner as all Points are in memory as objects and they are stored in many ArrayLists (one per document). So it works but doesn't scale. It will be replaced in the future.

  NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `defaultLength`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ShapeFieldCache(int length, int defaultLength)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(int docid, T s)`
    `List<T>` | `getShapes(int docid)`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### defaultLength

          public final int defaultLength

  - ### Constructor Detail

    - #### ShapeFieldCache

          public ShapeFieldCache(int length,
                                 int defaultLength)

  - ### Method Detail

    - #### add

          public void add(int docid,
                          T s)

    - #### getShapes

          public List<T> getShapes(int docid)

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