Interface GeoCache<T extends Cacheable>

Type Parameters:
T - the Cacheable object type
All Known Implementing Classes:
ExpiringGeoCache, JedisGeoCache, NullCache

public interface GeoCache<T extends Cacheable>
An interface for caches that cache data based on geographic locations.
Since:
7.3
Version:
8.1
Author:
Luke
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(GeoLocation loc, T data)
    Adds a geographically located object to the cache.
    void
    Adds a null entry to the cache.
    boolean
    Returns whether the cache contains an entry for a particular location.
    default String
    Creates a lat/long key by rounding to the specific number of decimal places.
    Retrieves an object from the cache.
    double
    Returns the precision of the lat/long key rounding.
    void
    Removes a location entry from the cache.
  • Method Details

    • getRoundingAmount

      double getRoundingAmount()
      Returns the precision of the lat/long key rounding.
      Returns:
      the rounding amount
    • add

      void add(GeoLocation loc, T data)
      Adds a geographically located object to the cache.
      Parameters:
      loc - the GeoLocation
      data - the data to cache
    • addNull

      void addNull(GeoLocation loc)
      Adds a null entry to the cache.
      Parameters:
      loc - the GeoLocation
    • contains

      boolean contains(GeoLocation loc)
      Returns whether the cache contains an entry for a particular location.
      Parameters:
      loc - the GeoLocation
      Returns:
      TRUE if the cache contains an entry, otherwise FALSE
    • get

      T get(GeoLocation loc)
      Retrieves an object from the cache.
      Parameters:
      loc - the GeoLocation
      Returns:
      the Object, or null if not found
    • remove

      void remove(GeoLocation loc)
      Removes a location entry from the cache.
      Parameters:
      loc - the GeoLocation
    • createGeoKey

      default String createGeoKey(GeoLocation loc)
      Creates a lat/long key by rounding to the specific number of decimal places.
      Parameters:
      loc - the GeoLocation
      Returns:
      a key