# Class: modelit.mapviewer.DiskCache

### Extends: modelit.mapviewer.Cache & matlab.mixin.SetGet & handle

## DESCRIPTION:

Cache to store items retrieved with the modelit.concurrent.ThreadPoolExecutor on disk.

#

## Properties

directory | String with the directory to which the CacheItems are saved. |
maxage | Number of days to keep the cachefiles. |

# Public Method: DiskCache

## DESCRIPTION:

Cache to store items retrieved with the modelit.concurrent.ThreadPoolExecutor on disk.

## CALL:

obj = DiskCache(directory)

## INPUT:

directory | string |
    with the directory in which to store the cachefiles.

## OUTPUT:

obj | modelit.mapviewer.DiskCache |
    Documentation for modelit.mapviewer.DiskCache/DiskCache
       doc modelit.mapviewer.DiskCache

# Public Method: add

## DESCRIPTION:

Add an item to the Cache.

## CALL:

add(obj, key, data, maxage)

## INPUT:

obj | modelit.mapviewer.DiskCache |
key | any |
    <string> key to retrieve the CacheItem.
data | any |
    <bytes> the data in a byte array.
maxage | any |
    <number> not used here, specified in modelit.mapviewer.Cache.

# Public Method: get

## DESCRIPTION:

Get an item from the Cache by using its key.

## CALL:

data = getCacheItem(obj, key)

## INPUT:

obj | modelit.mapviewer.DiskCache |
key | string |
    key to retrieve the CacheItem.

## OUTPUT:

data | any |
    <bytes> the data in a byte array.

# Public Method: clear

## DESCRIPTION:

Clear all the items in the Cache.

## CALL:

item = getCacheItem(obj, key)

## INPUT:

obj | modelit.mapviewer.DiskCache |

# Public Method: remove

## DESCRIPTION:

Remove an item with the specified key from the Cache.

## CALL:

remove(obj, key)

## INPUT:

obj | any |
    <modelit.mapviewer.DiskCache>
key | any |
    <string> key of the CacheItem to remove.

# Public Method: purge

### Inherited from modelit.mapviewer.Cache

## DESCRIPTION:

Remove all expired items from the Cache and limit the total items to maxItems.

## CALL:

purge(obj) Help for modelit.mapviewer.DiskCache/purge is inherited from superclass modelit.mapviewer.Cache