|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.edg.info.QueueDiskCache
Circular disk cache for storing tuples.
Field Summary | |
static char |
COLUMN_DELIMITER
Character used to separate columns. |
static char |
NULL_COLUMN
Character used to indicate a NULL column. |
static char |
NUMERIC_COLUMN
Character used to indicate a numeric column. |
static char |
STRING_COLUMN
Character used to indicate a string column. |
static char |
TUPLE_DELIMITER
Character used to separate tuples. |
Constructor Summary | |
QueueDiskCache(java.lang.String fileName,
int maxFileSizeBytes)
Creates a new QueueDiskCache object. |
Method Summary | |
void |
close()
Closes this disk cache and removes its file. |
boolean |
isEmpty()
Determines if the disk cache is full. |
boolean |
isFull()
Determines if the disk cache is full. |
java.util.List |
readTuples(int maxTuplesToRead)
Reads a list of tuples from this file. |
static java.lang.StringBuffer |
serialize(java.util.List tuples)
Serializes a list of tuples into a StringBuffer. |
static java.lang.StringBuffer |
serialize(Tuple tuple)
Serializes a tuple into a StringBuffer. |
void |
writeTuples(java.util.List tuples)
Serializes the tuple list to bytes and writes them to the cache. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final char TUPLE_DELIMITER
public static final char COLUMN_DELIMITER
public static final char NULL_COLUMN
public static final char NUMERIC_COLUMN
public static final char STRING_COLUMN
Constructor Detail |
public QueueDiskCache(java.lang.String fileName, int maxFileSizeBytes) throws java.io.FileNotFoundException, DiskCacheException
fileName
- Name of cache file to use.maxFileSizeBytes
- Max size of cache file.
java.io.FileNotFoundException
- If the specified file can not be created/written to.
DiskCacheException
- If the file size specified is invalid.Method Detail |
public java.util.List readTuples(int maxTuplesToRead) throws DiskCacheException, java.io.IOException
maxTuplesToRead
- Maximum number of tuples to read, -1
to read all available tuples.
Must not be zero.
java.io.IOException
- If the file access fails.
DiskCacheException
public void writeTuples(java.util.List tuples) throws DiskCacheException, java.io.IOException
tuples
- List of tuples.
DiskCacheException
- If the cache is full or closed or the tuples to
write are bigger than the cache.
java.io.IOException
- If the file access fails.public static java.lang.StringBuffer serialize(java.util.List tuples)
tuples
- Tuples to serialize.
public static java.lang.StringBuffer serialize(Tuple tuple)
tuple
- Tuple to serialize.
public boolean isFull()
public boolean isEmpty()
public void close()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |