|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.io.formats.dump.NamedObjectDump
public class NamedObjectDump
This is similar to the ObjectDump, except that it is indexed by a string name rather than an integer ID. Essentially, it is WORM - you can dump an object to it, in which case the object is appended, in serialized form, with its name to the data file, and an entry added to the offset file. You can then ask for that object by index number. Not threadsafe. Write a wrapper if you need thread safety.
Compressed by default; optional constructor for uncompressed mode.
| Constructor Summary | |
|---|---|
NamedObjectDump(java.lang.String filename)
Creates a NamedObjectDump file for the given filename base (everything but the extensions). |
|
| Method Summary | |
|---|---|
void |
appendObject(java.lang.String name,
java.lang.Object victim)
|
void |
clear()
|
java.io.File |
getDataFile()
|
java.io.File |
getOffsetFile()
|
int |
getSize()
|
void |
pack()
|
java.lang.String |
readName(int index)
|
java.lang.Object |
readObject(int index)
|
java.lang.Object |
readObject(java.lang.String name)
If cached == true, this is a cached version of readObjectUncached. |
java.lang.Object |
readObjectImp(java.io.DataInputStream dater)
|
java.lang.Object |
readObjectUncached(java.lang.String name)
This requires that the file be sorted. |
void |
sort()
|
void |
sortInMemory()
|
void |
sortOnDisk()
|
void |
swap(int a,
int b)
|
void |
writeObjectImp(java.lang.Object victim,
java.io.DataOutputStream outie)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NamedObjectDump(java.lang.String filename)
| Method Detail |
|---|
public int getSize()
public java.io.File getDataFile()
public java.io.File getOffsetFile()
public void appendObject(java.lang.String name,
java.lang.Object victim)
throws java.io.IOException
java.io.IOException
public void writeObjectImp(java.lang.Object victim,
java.io.DataOutputStream outie)
throws java.io.IOException
java.io.IOException
public java.lang.Object readObject(java.lang.String name)
throws java.io.IOException
java.io.IOException
public java.lang.Object readObjectUncached(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.Object readObjectImp(java.io.DataInputStream dater)
throws java.io.IOException
java.io.IOException
public java.lang.String readName(int index)
throws java.io.IOException
java.io.IOException
public void clear()
throws java.io.IOException
java.io.IOException
public void swap(int a,
int b)
throws java.io.IOException
java.io.IOExceptionpublic void sort()
public void pack()
throws java.io.IOException
java.io.IOExceptionpublic void sortOnDisk()
public void sortInMemory()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||