Class LRUCache

java.lang.Object
com.jayway.jsonpath.spi.cache.LRUCache
All Implemented Interfaces:
Cache

public class LRUCache extends Object implements Cache
  • Field Details

  • Constructor Details

    • LRUCache

      public LRUCache(int limit)
  • Method Details

    • put

      public void put(String key, JsonPath value)
      Description copied from interface: Cache
      Add JsonPath to the cache
      Specified by:
      put in interface Cache
      Parameters:
      key - cache key to store the JsonPath
      value - JsonPath to be cached
    • get

      public JsonPath get(String key)
      Description copied from interface: Cache
      Get the Cached JsonPath
      Specified by:
      get in interface Cache
      Parameters:
      key - cache key to lookup the JsonPath
      Returns:
      JsonPath
    • addKey

      private void addKey(String key)
    • removeLast

      private String removeLast()
    • removeThenAddKey

      private void removeThenAddKey(String key)
    • removeFirstOccurrence

      private void removeFirstOccurrence(String key)
    • getSilent

      public JsonPath getSilent(String key)
    • remove

      public void remove(String key)
    • size

      public int size()
    • toString

      public String toString()
      Overrides:
      toString in class Object