Package de.dlr.proseo.storagemgr.cache
Class MapCache
java.lang.Object
de.dlr.proseo.storagemgr.cache.MapCache
Map wrapper for file cache with path as key and last accessed and file size
as value
- Author:
- Denys Chaykovskiy
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classSorting by accessed Ascending Comparator(package private) classSorting by accessed Descending Comparator(package private) classSorting by size Ascending Comparator(package private) classSorting by size Descending Comparator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all elements from the cachebooleancontainsKey(String pathKey) Returns true if cache has an element with pathkeyGets the file infogetCache()Gets a clone of cacheGets sorted pathesvoidPuts pathkey and fileinfo as a record to path cachevoidRemoves the element from the cacheintsize()Returns the number of elements in the cachevoidSorting by last Accessed AscendingvoidSorting by last Accessed DescendingvoidSorting by File Size AscendingvoidSorting by File Size Descending
-
Constructor Details
-
MapCache
public MapCache()
-
-
Method Details
-
getSortedPathes
Gets sorted pathes- Returns:
- list of sorted pathes
-
getCache
Gets a clone of cache- Returns:
- cloned cache
-
put
Puts pathkey and fileinfo as a record to path cache- Parameters:
pathKey- path of the filefileInfo- File info as a value
-
get
Gets the file info- Parameters:
pathKey- path of the file- Returns:
- file info
-
remove
Removes the element from the cache- Parameters:
pathKey- path of the file
-
clear
public void clear()Removes all elements from the cache -
containsKey
Returns true if cache has an element with pathkey- Parameters:
pathKey- Path of the file- Returns:
- true if cache has an element
-
size
public int size()Returns the number of elements in the cache- Returns:
- 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
-