net.aerith.misao.io
Class CacheEntry

java.lang.Object
  |
  +--net.aerith.misao.io.CacheEntry

public class CacheEntry
extends java.lang.Object

The CacheEntry represents an entry of a file in the disk cache.


Field Summary
protected  java.lang.Object content
          The file content.
protected  long last_used
          The last used time.
protected  java.lang.String path
          The file path.
protected  int update_count
          The update count.
 
Constructor Summary
CacheEntry(java.lang.String path, java.lang.Object content)
          Constructs a CacheEntry.
 
Method Summary
 java.lang.Object getContent()
          Gets the content.
 long getLastUsedTimeMillis()
          Gets the last used time in milli seconds.
 java.lang.String getPath()
          Gets the file path.
 int getUpdateCount()
          Gets the update count.
 boolean isUpdated()
          Returns true when the entry is updated.
 void resetUpdateCount()
          Resets the update count.
 void update(java.lang.Object new_content)
          Updates the file content.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

path

protected java.lang.String path
The file path.

content

protected java.lang.Object content
The file content.

update_count

protected int update_count
The update count.

last_used

protected long last_used
The last used time.
Constructor Detail

CacheEntry

public CacheEntry(java.lang.String path,
                  java.lang.Object content)
Constructs a CacheEntry.
Parameters:
path - the file path.
content - the file content.
Method Detail

getPath

public java.lang.String getPath()
Gets the file path.
Returns:
the file path.

getContent

public java.lang.Object getContent()
Gets the content.
Returns:
the content.

getLastUsedTimeMillis

public long getLastUsedTimeMillis()
Gets the last used time in milli seconds.
Returns:
the last used time in milli seconds.

isUpdated

public boolean isUpdated()
Returns true when the entry is updated.
Returns:
true when the entry is updated.

getUpdateCount

public int getUpdateCount()
Gets the update count.
Returns:
the update count.

resetUpdateCount

public void resetUpdateCount()
Resets the update count.

update

public void update(java.lang.Object new_content)
Updates the file content.
Parameters:
new_content - the new file content.