|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ccs.beetree.BeeObject ccs.cdb.CDBObject ccs.cdb.CDBFileSysObject ccs.cdb.CDBDirectory
public class CDBDirectory
An object which stores a table of unique strings as a CDBObject. This is used to provide listings of "directories" of CDBFiles. This allows a CDB of CDBFiles to be used as a "virtual filesystem". The strings are stored in memory by a hashtable.
Field Summary |
---|
Fields inherited from class ccs.cdb.CDBObject |
---|
clone, key, marshalVersion, owner |
Fields inherited from class ccs.beetree.BeeObject |
---|
cipher, encodedLength, isBodiless, isForceDirectDecrypt, isZip, slack |
Constructor Summary | |
---|---|
CDBDirectory()
Create an empty CDBDirectory. |
Method Summary | |
---|---|
boolean |
contains(java.lang.String s)
Whether the a string matching the argument is present in the table. |
protected void |
cpmarshal(java.io.DataOutputStream dos)
override this to marshal your data, just like marshal . |
protected void |
cpunmarshal(java.io.DataInputStream dis,
int marshalver)
override this to unmarshal your data, just like unmarshal . |
void |
delete(java.lang.String loseMe)
Deletes the supplied string (well, the one containing the same character sequence as the supplied string, .equals() rather than
== ) from the table. |
java.lang.String[] |
getEntries()
returns an array containing all the strings in the table. |
int |
getNEntries()
Returns the number of entries in the table. |
java.lang.String |
getPath()
Returns the previously-set path. |
void |
insert(java.lang.String newItem)
Insert a fresh string into the table. |
void |
setPath(java.lang.String path)
Set the path (i.e. |
Methods inherited from class ccs.cdb.CDBObject |
---|
canChangeKeyProgrammatically, canDeleteProgrammatically, canUpdateProgrammatically, cpgetKey, cpgetMarshalledLength, cppreMarshal, cppreUnmarshal, cpsetKey, getCDB, getKey, getMarshalledLength, marshal, preMarshal, preUnmarshal, setCDB, setKey, transientMarshal, transientUnmarshal, unmarshal |
Methods inherited from class ccs.beetree.BeeObject |
---|
lock, unlock |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CDBDirectory()
Method Detail |
---|
public void setPath(java.lang.String path)
public java.lang.String getPath()
public void insert(java.lang.String newItem) throws java.io.IOException
newItem
- The string to insert.
java.io.IOException
- if the string is already present in the table.public void delete(java.lang.String loseMe) throws java.io.IOException
.equals()
rather than
==
) from the table. As noted above, all strings are unique so no
question of "which one of several identical ones?" arises.
loseMe
- The String to remove.
java.io.IOException
- if no such string is present.public boolean contains(java.lang.String s)
s
- The string to check for.
public int getNEntries()
public java.lang.String[] getEntries()
protected void cpmarshal(java.io.DataOutputStream dos) throws java.io.IOException
CDBObject
marshal
.
The data will be in the object's fields when this is called (rather than
within any UI objects).
cpmarshal
in class CDBFileSysObject
dos
- The stream to marshal onto.
java.io.IOException
- If this breaks (breaks the CDB too).protected void cpunmarshal(java.io.DataInputStream dis, int marshalver) throws java.io.IOException
CDBObject
unmarshal
.
cpunmarshal
in class CDBFileSysObject
dis
- The stream to unmarshal frommarshalver
- The marshal version of the data in src - i.e. the
version of this class which wrote the data. This may be
different from the current marshalVersion
. If so (i.e. the
stored data is the wrong version) your method should allow for it.
This allows comparatively painless data migration between versions of
your objects.
java.io.IOException
- if this breaks (breaks the CDB too).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |