public class CASAFileIndex extends Object
Copyright: Copyright 2003-2014, Knowledge Science Group, University of Calgary. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The Knowledge Science Group makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Modifier and Type | Field and Description |
---|---|
protected static long |
DEFAULT_INDEX_BLOCK_SIZE |
static String |
ENTRY_ENCODING
The encoding used for the index entry names.
|
private FilePosition |
filePos |
static String |
INDEX_ENTRY_NAME
The reserved name for the index within the index
|
Constructor and Description |
---|
CASAFileIndex(CASAFile file) |
Modifier and Type | Method and Description |
---|---|
protected long |
addEntry(String name,
long offset)
returns the index offset to this entry (exceptions if unsuccessful)
|
protected static CASAFileBlock |
createDefaultIndexBlock()
Utility method to create a default block containing an initial index block.
|
Vector |
getEntries()
Get a list of all entries within the file.
|
CASAFileIndexEntry |
getEntry(String name)
Get the given nodes index entry.
|
long |
getLength()
return the length (in bytes) of the index
|
int |
getNumberOfEntries() |
static boolean |
isReservedName(String name)
Determine if a node name is actually a reserved name
|
private CASAFileIndexEntry |
nextEntry(CASAInputStream in) |
protected CASAFileIndexEntry |
removeEntry(String name)
returns the entry removed if entry existed in index, otherwise null
|
public static final String INDEX_ENTRY_NAME
public static final String ENTRY_ENCODING
protected static final long DEFAULT_INDEX_BLOCK_SIZE
private FilePosition filePos
public CASAFileIndex(CASAFile file)
public static boolean isReservedName(String name)
public CASAFileIndexEntry getEntry(String name) throws IOException, CASAIOException
IOException
CASAIOException
public Vector getEntries() throws IOException, CASAIOException
IOException
CASAIOException
private CASAFileIndexEntry nextEntry(CASAInputStream in) throws IOException, CASAIOException
IOException
CASAIOException
public long getLength() throws CASAIOException, IOException
CASAIOException
IOException
protected long addEntry(String name, long offset) throws CASAIOException, IOException
CASAIOException
IOException
protected CASAFileIndexEntry removeEntry(String name) throws CASAIOException, IOException
CASAIOException
IOException
public int getNumberOfEntries()
protected static CASAFileBlock createDefaultIndexBlock() throws IOException, CASAIOException
IOException
CASAIOException