|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hyperic.util.file.DiskList
public class DiskList
A DiskList is a representation of a list on disk. The basic usage is to add members to the end of the list, and remove entries from it. The iterators returned support the remove() operation, but will throw a ConcurrentModificationException and fail-fast if an update is detected while iteration is occuring. The storage is contained in 2 files, one housing the data, and the other housing the index. The format of the data file is as follows: [Record] data - recordSize bytes containing the raw data The format of the index file is as follows: [Idx] boolean - Indicates whether the record is in use or not long int - Index of the previous record long int - Index of the next record
Nested Class Summary | |
---|---|
static class |
DiskList.DiskListIterator
|
Field Summary | |
---|---|
protected java.io.RandomAccessFile |
dataFile
|
protected java.util.SortedSet |
freeList
|
Constructor Summary | |
---|---|
DiskList(java.io.File dataFile,
int recordSize,
long checkSize,
int checkPerc)
Construct a new DiskList |
|
DiskList(java.io.File dataFile,
int recordSize,
long checkSize,
int checkPerc,
long maxLength)
Construct a new DiskList |
Method Summary | |
---|---|
void |
addToList(java.lang.String data)
Add the string to the list of data being stored in the DiskList. |
void |
close()
Close the DiskList. |
void |
deleteAllRecords()
Delete all the records from storage. |
java.util.Iterator |
getListIterator()
|
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.io.RandomAccessFile dataFile
protected java.util.SortedSet freeList
Constructor Detail |
---|
public DiskList(java.io.File dataFile, int recordSize, long checkSize, int checkPerc) throws java.io.IOException
java.io.IOException
public DiskList(java.io.File dataFile, int recordSize, long checkSize, int checkPerc, long maxLength) throws java.io.IOException
dataFile
- the base location for the datafile. The index
file will be the same, with .idx appendedrecordSize
- The maximum size for any record within the
data file. All records in the list will
occupy this many bytes worth of datacheckSize
- Size in to bytes to start checking for
unused blockscheckPerc
- Maximum percentage of free blocks allowed when
data file is greater than checkSize.
java.io.IOException
Method Detail |
---|
public void addToList(java.lang.String data) throws java.io.IOException
data
- Data to add to the end of the list
java.io.IOException
public void deleteAllRecords() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public java.util.Iterator getListIterator()
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |