Class FeatureCache

java.lang.Object
mil.nga.geopackage.features.user.FeatureCache

public class FeatureCache extends Object
Feature Row Cache for a single feature table
Since:
3.2.0
  • Field Details

    • DEFAULT_CACHE_MAX_SIZE

      public static final int DEFAULT_CACHE_MAX_SIZE
      Default max number of feature rows to retain in cache
      See Also:
  • Constructor Details

    • FeatureCache

      public FeatureCache()
      Constructor, created with cache max size of DEFAULT_CACHE_MAX_SIZE
    • FeatureCache

      public FeatureCache(int maxSize)
      Constructor
      Parameters:
      maxSize - max feature rows to retain in the cache
  • Method Details

    • getMaxSize

      public int getMaxSize()
      Get the cache max size
      Returns:
      max size
    • getSize

      public int getSize()
      Get the current cache size, number of feature rows cached
      Returns:
      cache size
    • get

      public FeatureRow get(long featureId)
      Get the cached feature row by feature id
      Parameters:
      featureId - feature row id
      Returns:
      feature row or null
    • put

      public FeatureRow put(FeatureRow featureRow)
      Cache the feature row
      Parameters:
      featureRow - feature row
      Returns:
      previous cached feature row or null
    • remove

      public FeatureRow remove(FeatureRow featureRow)
      Remove the cached feature row
      Parameters:
      featureRow - feature row
      Returns:
      removed feature row or null
    • remove

      public FeatureRow remove(long featureId)
      Remove the cached feature row by id
      Parameters:
      featureId - feature row id
      Returns:
      removed feature row or null
    • clear

      public void clear()
      Clear the cache
    • resize

      public void resize(int maxSize)
      Resize the cache
      Parameters:
      maxSize - max size
    • clearAndResize

      public void clearAndResize(int maxSize)
      Clear and resize the cache
      Parameters:
      maxSize - max size of the cache