com.android.volley.toolbox
クラス DiskBasedCache

java.lang.Object
  上位を拡張 com.android.volley.toolbox.DiskBasedCache
すべての実装されたインタフェース:
Cache

public class DiskBasedCache
extends java.lang.Object
implements Cache

Cache implementation that caches files directly onto the hard disk in the specified directory. The default disk usage size is 5MB, but is configurable.


入れ子のクラスの概要
 
インタフェース com.android.volley.Cache から継承された入れ子のクラス/インタフェース
Cache.Entry
 
コンストラクタの概要
DiskBasedCache(java.io.File rootDirectory)
          Constructs an instance of the DiskBasedCache at the specified directory using the default maximum cache size of 5MB.
DiskBasedCache(java.io.File rootDirectory, int maxCacheSizeInBytes)
          Constructs an instance of the DiskBasedCache at the specified directory.
 
メソッドの概要
 void clear()
          Clears the cache.
 Cache.Entry get(java.lang.String key)
          Returns the cache entry with the specified key if it exists, null otherwise.
 java.io.File getFileForKey(java.lang.String key)
          Returns a file object for the given cache key.
 void initialize()
          Initializes the DiskBasedCache by scanning for all files currently in the specified root directory.
 void invalidate(java.lang.String key, boolean fullExpire)
          Invalidates an entry in the cache.
 void put(java.lang.String key, Cache.Entry entry)
          Puts the entry with the specified key into the cache.
 void remove(java.lang.String key)
          Removes the specified key from the cache if it exists.
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

DiskBasedCache

public DiskBasedCache(java.io.File rootDirectory,
                      int maxCacheSizeInBytes)
Constructs an instance of the DiskBasedCache at the specified directory.

パラメータ:
rootDirectory - The root directory of the cache.
maxCacheSizeInBytes - The maximum size of the cache in bytes.

DiskBasedCache

public DiskBasedCache(java.io.File rootDirectory)
Constructs an instance of the DiskBasedCache at the specified directory using the default maximum cache size of 5MB.

パラメータ:
rootDirectory - The root directory of the cache.
メソッドの詳細

clear

public void clear()
Clears the cache. Deletes all cached files from disk.

定義:
インタフェース Cache 内の clear

get

public Cache.Entry get(java.lang.String key)
Returns the cache entry with the specified key if it exists, null otherwise.

定義:
インタフェース Cache 内の get
パラメータ:
key - Cache key
戻り値:
An Cache.Entry or null in the event of a cache miss

initialize

public void initialize()
Initializes the DiskBasedCache by scanning for all files currently in the specified root directory. Creates the root directory if necessary.

定義:
インタフェース Cache 内の initialize

invalidate

public void invalidate(java.lang.String key,
                       boolean fullExpire)
Invalidates an entry in the cache.

定義:
インタフェース Cache 内の invalidate
パラメータ:
key - Cache key
fullExpire - True to fully expire the entry, false to soft expire

put

public void put(java.lang.String key,
                Cache.Entry entry)
Puts the entry with the specified key into the cache.

定義:
インタフェース Cache 内の put
パラメータ:
key - Cache key
entry - Data to store and metadata for cache coherency, TTL, etc.

remove

public void remove(java.lang.String key)
Removes the specified key from the cache if it exists.

定義:
インタフェース Cache 内の remove
パラメータ:
key - Cache key

getFileForKey

public java.io.File getFileForKey(java.lang.String key)
Returns a file object for the given cache key.