Class FilteringContext

java.lang.Object
org.apache.sis.internal.feature.jts.FilteringContext

final class FilteringContext extends Object
Helper objects needed during the execution of a filtering operation. Those objects are assumed non-thread safe; different instances will be created for each thread.

Ideally this object should be created when a filtering operation on a collection of features is about to start, and disposed after the filtering operation is completed. We do not yet have a notification mechanism for those events, so current implementation use a ThreadLocal. A future version may revisit this strategy and expand the use of "filtering context" to all geometry implementations, not only JTS (but we may keep a specialized JTS subclass).

Since:
1.1
Version:
1.1
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final AtomicBoolean
    A flag telling whether a cleaning task has been registered.
    private static final Queue<org.locationtech.jts.io.WKBWriter>
    Well-Known Binary (WKB) writers of geometry objects.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Do not allow (in current version) instantiation of this class.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static byte[]
    writeWKB(org.locationtech.jts.geom.Geometry geometry)
    Writes the given geometry in Well-Known Binary (WKB) format.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • WRITERS

      private static final Queue<org.locationtech.jts.io.WKBWriter> WRITERS
      Well-Known Binary (WKB) writers of geometry objects. This is currently the only kind of objects that we recycle because it contains potentially large buffer arrays. All other JTS readers and writers are cheap to construct, so caching them may be counter-productive.
    • CLEANER_REGISTERED

      private static final AtomicBoolean CLEANER_REGISTERED
      A flag telling whether a cleaning task has been registered.
  • Constructor Details

    • FilteringContext

      private FilteringContext()
      Do not allow (in current version) instantiation of this class.
  • Method Details

    • writeWKB

      static byte[] writeWKB(org.locationtech.jts.geom.Geometry geometry)
      Writes the given geometry in Well-Known Binary (WKB) format.