Klasse MapCache

java.lang.Object
de.dlr.proseo.storagemgr.cache.MapCache

public class MapCache extends Object
Map wrapper for file cache with path as key and last accessed and file size as value
Autor:
Denys Chaykovskiy
  • Konstruktordetails

    • MapCache

      public MapCache()
  • Methodendetails

    • getSortedPathes

      public List<Map.Entry<String,FileInfo>> getSortedPathes()
      Gets sorted pathes
      Gibt zurück:
      list of sorted pathes
    • getCache

      public Map<String,FileInfo> getCache()
      Gets a clone of cache
      Gibt zurück:
      cloned cache
    • put

      public void put(String pathKey, FileInfo fileInfo)
      Puts pathkey and fileinfo as a record to path cache
      Parameter:
      pathKey - path of the file
      fileInfo - File info as a value
    • get

      public FileInfo get(String pathKey)
      Gets the file info
      Parameter:
      pathKey - path of the file
      Gibt zurück:
      file info
    • remove

      public void remove(String pathKey)
      Removes the element from the cache
      Parameter:
      pathKey - path of the file
    • clear

      public void clear()
      Removes all elements from the cache
    • containsKey

      public boolean containsKey(String pathKey)
      Returns true if cache has an element with pathkey
      Parameter:
      pathKey - Path of the file
      Gibt zurück:
      true if cache has an element
    • size

      public int size()
      Returns the number of elements in the cache
      Gibt zurück:
      size of the cache
    • sortByFileSizeAsc

      public void sortByFileSizeAsc()
      Sorting by File Size Ascending
    • sortByFileSizeDesc

      public void sortByFileSizeDesc()
      Sorting by File Size Descending
    • sortByAccessedAsc

      public void sortByAccessedAsc()
      Sorting by last Accessed Ascending
    • sortByAccessedDesc

      public void sortByAccessedDesc()
      Sorting by last Accessed Descending