|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.io.formats.dump.PackedNamedRandomAccessObjectDump
public abstract class PackedNamedRandomAccessObjectDump
This is a packed (single file) version of a NamedObjectDump, that uses a RandomAccessFile for i/o. Read-only; you must first create and sort a NamedObjectDump then run the pack() method on it. Not threadsafe. Write a wrapper if you need thread safety.
Compressed by default; optional constructor for uncompressed mode.
| Constructor Summary | |
|---|---|
PackedNamedRandomAccessObjectDump(java.io.File filet)
Creates a PackedNamedRandomAccessObjectDump file for the given filename. |
|
| Method Summary | |
|---|---|
void |
close()
|
void |
finalize()
|
int |
findClosest(java.lang.String key)
Returns the index of the "closest" record matching the given key (this would be the insertion point if you were to insert the given key) Uses binary search, so the file has to be sorted first. |
java.io.File |
getFile()
|
int |
getSize()
|
int |
indexOf(java.lang.String name)
|
java.lang.String |
readName(int index)
|
java.lang.Object |
readObject(int index)
|
java.lang.Object |
readObject(java.lang.String name)
This requires that the file be sorted. |
protected abstract java.lang.Object |
readObjectImp(java.lang.String name,
java.io.RandomAccessFile filet)
Override this to provide custom reading of your data. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PackedNamedRandomAccessObjectDump(java.io.File filet)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public void close()
public void finalize()
finalize in class java.lang.Objectpublic int getSize()
public int indexOf(java.lang.String name)
public java.lang.Object readObject(java.lang.String name)
throws java.io.IOException
java.io.IOException
public java.lang.Object readObject(int index)
throws java.io.IOException
java.io.IOException
public java.lang.String readName(int index)
throws java.io.IOException
java.io.IOExceptionpublic int findClosest(java.lang.String key)
public java.io.File getFile()
protected abstract java.lang.Object readObjectImp(java.lang.String name,
java.io.RandomAccessFile filet)
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||