Package | Description |
---|---|
casa.io |
Contains classes implementing CASA's agent persistence system.
|
casa.io.tools |
Modifier and Type | Class and Description |
---|---|
class |
NodeNotFoundException
Copyright: Copyright 2003-2014, Knowledge Science Group, University of Calgary.
|
Modifier and Type | Method and Description |
---|---|
protected void |
CASAFileFreeList.addBlock(long freeBlock)
Add a block to the free list.
|
protected long |
CASAFileIndex.addEntry(String name,
long offset)
returns the index offset to this entry (exceptions if unsuccessful)
|
protected static FilePosition |
CoreIO.appendBlock(CASAFileBlock block,
CASAFile file) |
protected static void |
CoreIO.clearBlocks(FilePosition pos)
go through all blocks (including first) and set free data size == total data area
|
protected static CASAFileBlock |
CASAFileIndex.createDefaultIndexBlock()
Utility method to create a default block containing an initial index block.
|
void |
CASAFile.defragment()
defrag this file
|
void |
CASAFile.defragment(PrintStream log)
Defrag this file, writing progress and summary to out (if != null).
|
boolean |
CASAFile.deleteNode(String nodeName)
Delete the given node from the file.
|
protected long |
CASAFileFreeList.getBlock()
Remove a block from the free list and returns the file offset to it.
|
Vector |
CASAFileIndex.getEntries()
Get a list of all entries within the file.
|
CASAFileIndexEntry |
CASAFileIndex.getEntry(String name)
Get the given nodes index entry.
|
protected static FilePosition |
CoreIO.getFilePosition(CASAFile file,
NodePosition nodePos)
convert the supplied node position into a file position
returns null if node not found
|
protected static FilePosition |
CoreIO.getFirstWritePosition(CASAFile file,
long offset,
int mode) |
Vector |
CASAFileFreeList.getFreeBlocks()
Get a list of the file offsets to any free blocks.
|
CASAFileFreeList |
CASAFile.getFreeList()
Get this files free block list.
|
CASAFileIndex |
CASAFile.getIndex()
Get this files index.
|
long |
CASAFileIndex.getLength()
return the length (in bytes) of the index
|
protected static long |
CoreIO.getNodeLength(CASAFile file,
String nodeName) |
protected static long |
CoreIO.getNodeLength(FilePosition pos) |
long |
CASAFile.getNodeLength(String nodeName)
Calculate the size of a node within the file.
|
boolean |
CASAFileFreeList.hasBlocks()
simple method to determine if the free list is empty or not
|
private CASAFileIndexEntry |
CASAFileIndex.nextEntry(CASAInputStream in) |
int |
CASAFile.read(byte[] bytes,
NodePosition pos)
convenience method for reading bytes from a node
|
int |
CASAFile.read(byte[] bytes,
NodePosition nodePos,
int start,
int length)
Read length bytes from the given node position within the file and store them
in the supplied byte array.
|
int |
CASAFile.read(byte[] bytes,
String node)
convenience method for reading bytes from a node
|
int |
CASAFile.read(byte[] bytes,
String node,
long dataOffset,
int start,
int length)
convenience method for reading bytes from a node
|
protected static int |
CoreIO.read(FilePosition pos,
byte[] bytes,
int start,
int byteCount) |
protected static int |
CoreIO.read(FilePosition pos,
byte[] bytes,
int start,
int byteCount,
RandomAccessFile file)
read an arbitrary number of bytes from file
|
protected static CASAFileBlock |
CoreIO.readBlock(CASAFile file,
long offset) |
protected static CASAFileBlock |
CoreIO.readBlock(FilePosition pos) |
protected static CASAFileBlock |
CoreIO.readBlock(FilePosition pos,
RandomAccessFile aFile) |
protected static CASAFileBlockHeader |
CoreIO.readBlockHeader(CASAFile file,
long offset) |
protected static CASAFileBlockHeader |
CoreIO.readBlockHeader(FilePosition pos) |
protected static CASAFileBlockHeader |
CoreIO.readBlockHeader(FilePosition pos,
RandomAccessFile aFile) |
protected static CASAFileBlockHeader |
CoreIO.readBlockHeader(long offset,
RandomAccessFile aFile) |
protected static CASAFileHeader |
CoreIO.readFileHeader(CASAFile file) |
protected static CASAFileHeader |
CoreIO.readFileHeader(RandomAccessFile file) |
protected CASAFileIndexEntry |
CASAFileIndex.removeEntry(String name)
returns the entry removed if entry existed in index, otherwise null
|
protected void |
CASAFileBlockHeader.setFreeDataSize(long value) |
protected static void |
CoreIO.setIndexOffset(FilePosition pos,
long indexOffset)
convenience method to set the index offset in one (or more) block headers
this method follows all next links and ensures that the index offset is
consistent accross all blocks containing a node
|
protected void |
CASAFileBlockHeader.setIndexOffset(long value) |
protected void |
CASAFileBlockHeader.setNextOffset(long value) |
int |
CASAFile.write(byte[] bytes,
NodePosition pos)
convenience method for writing bytes to a node
|
int |
CASAFile.write(byte[] bytes,
NodePosition nodePos,
int start,
int length)
write bytes to the given node position within the file.
|
int |
CASAFile.write(byte[] bytes,
String node)
convenience method for writing bytes to a node
|
int |
CASAFile.write(byte[] bytes,
String node,
int mode,
int start,
int length)
convenience method for writing bytes to a node
|
protected static FilePosition |
CoreIO.write(FilePosition pos,
byte[] bytes)
Writes the specified data to the file for the specified node.
|
protected static FilePosition |
CoreIO.write(FilePosition pos,
byte[] bytes,
int startIndex,
int dataCount) |
protected static FilePosition |
CoreIO.write(FilePosition pos,
byte[] bytes,
int startIndex,
int dataCount,
RandomAccessFile aFile) |
Constructor and Description |
---|
CASAFileBlock(byte[] dataBytes) |
CASAFileBlock(int dataSize)
construct a file block that contains a data area of size >= dataSize
|
CASAFileBlock(long indexOffset,
byte[] dataBytes) |
CASAFileBlock(long indexOffset,
byte[] dataBytes,
int start,
int dataCount) |
CASAFileBlockHeader(byte[] bytes) |
CASAFileBlockHeader(long indexOffset,
long blockSize) |
CASAFileBlockHeader(long indexOffset,
long blockSize,
long freeSize,
long nextOffset) |
CASAFileHeader(byte[] bytes) |
CASAInputStream(FilePosition pos,
String nodeName) |
CASAInputStream(NodePosition pos,
CASAFile file) |
CASAInputStream(String nodeName) |
CASAInputStream(String nodeName,
CASAFile file) |
CASAOutputStream(FilePosition pos,
int writeMode)
protected constructors - allows writing to reserved nodes
assumes parameters etc are valid
|
CASAOutputStream(String nodeName) |
CASAOutputStream(String nodeName,
int writeMode,
CASAFile file) |
Modifier and Type | Method and Description |
---|---|
void |
CASAFileTreeModel.setFile(CASAFile file) |
void |
CASAFileTree.setFile(CASAFile file) |
Constructor and Description |
---|
CASAFileTree(CASAFile file) |
CASAFileTreeModel(CASAFile file) |