mailpuccino
Class Cache

java.lang.Object
  extended bymailpuccino.Cache
Direct Known Subclasses:
MsgPartsCache

public class Cache
extends java.lang.Object


Field Summary
protected  java.io.RandomAccessFile Data
           
protected  java.io.File DataFile
           
protected  java.io.File IndexFile
           
protected  java.util.Hashtable KeyValues
           
 
Constructor Summary
Cache(java.io.File IndexFile, java.io.File DataFile)
           
 
Method Summary
 void close()
           
 void compact()
           
 void flush()
           
 java.lang.String get(java.lang.Object Key)
           
 byte[] getAsByteArray(java.lang.Object Key)
           
 java.util.Enumeration getKeys()
           
(package private)  void init()
           
 void keepOnlyThese(java.util.Vector Keys)
           
 void put(java.lang.Object Key, java.lang.Object Value)
           
(package private)  byte[] readByteArray(java.io.RandomAccessFile Input)
           
(package private)  java.lang.String readString(java.io.RandomAccessFile Input)
           
 void remove(java.lang.Object Key)
           
(package private)  void write(java.io.RandomAccessFile Output, java.lang.Object Value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IndexFile

protected java.io.File IndexFile

DataFile

protected java.io.File DataFile

Data

protected java.io.RandomAccessFile Data

KeyValues

protected java.util.Hashtable KeyValues
Constructor Detail

Cache

public Cache(java.io.File IndexFile,
             java.io.File DataFile)
      throws java.io.IOException
Method Detail

init

void init()
    throws java.io.IOException
Throws:
java.io.IOException

getKeys

public java.util.Enumeration getKeys()

getAsByteArray

public byte[] getAsByteArray(java.lang.Object Key)
                      throws java.io.IOException
Throws:
java.io.IOException

get

public java.lang.String get(java.lang.Object Key)
                     throws java.io.IOException
Throws:
java.io.IOException

put

public void put(java.lang.Object Key,
                java.lang.Object Value)
         throws java.io.IOException
Throws:
java.io.IOException

remove

public void remove(java.lang.Object Key)

keepOnlyThese

public void keepOnlyThese(java.util.Vector Keys)

flush

public void flush()
           throws java.io.IOException
Throws:
java.io.IOException

compact

public void compact()
             throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

readByteArray

byte[] readByteArray(java.io.RandomAccessFile Input)
               throws java.io.IOException
Throws:
java.io.IOException

readString

java.lang.String readString(java.io.RandomAccessFile Input)
                      throws java.io.IOException
Throws:
java.io.IOException

write

void write(java.io.RandomAccessFile Output,
           java.lang.Object Value)
     throws java.io.IOException
Throws:
java.io.IOException