com.application.areca.cache
Class ArchiveDataMap

java.lang.Object
  extended by com.application.areca.cache.ArchiveDataMap

public class ArchiveDataMap
extends java.lang.Object

Sorted cache of data for a given FileSystemArchiveMedium.
These data are indexed by File.
It counts the usage of each file and build an eviction strategy upon these statistics.
It checks that the underlying file key hasn't been modified since the caching of the data and refreshes its content if needed.

This class is not synchronized. The caller must manage concurrent accesses.

Author:
Olivier PETRUCCI

Areca Build ID : 7299034069467778562

Constructor Summary
ArchiveDataMap()
           
 
Method Summary
 void clear()
          Clears the map's content but keeps the usage count.
 double computeScore()
          Computes a score used by the eviction strategy
 java.lang.Object get(java.io.File key)
           
 boolean isEmpty()
           
 java.util.Iterator keyIterator()
           
 void put(java.io.File key, java.lang.Object data, long approximateSize)
           
protected  void registerUsage()
          Registers that the cache has been used
 java.lang.Object remove(java.io.File key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArchiveDataMap

public ArchiveDataMap()
Method Detail

get

public java.lang.Object get(java.io.File key)

computeScore

public double computeScore()
Computes a score used by the eviction strategy


put

public void put(java.io.File key,
                java.lang.Object data,
                long approximateSize)

remove

public java.lang.Object remove(java.io.File key)

keyIterator

public java.util.Iterator keyIterator()

clear

public void clear()
Clears the map's content but keeps the usage count.


isEmpty

public boolean isEmpty()

registerUsage

protected void registerUsage()
Registers that the cache has been used