ccs.beetree
Class BeeGeneric

java.lang.Object
  extended by ccs.beetree.BeeObject
      extended by ccs.beetree.BeeGeneric

public class BeeGeneric
extends BeeObject

A fairly dumb BeeObject used as a transport by BeeCompactor. The object is unmarshalled into / out of a swappingbuffer. Left public since it might possibly be useful elsewhere. However, applications should use more specialised classes in most cases. In particular, only CDBObject subclasses are allowed in CDB's (Checkpoint DataBases).


Field Summary
 
Fields inherited from class ccs.beetree.BeeObject
cipher, encodedLength, isBodiless, isForceDirectDecrypt, isZip, slack
 
Constructor Summary
  BeeGeneric()
           
protected BeeGeneric(BeeTreeCompactor patron)
           
 
Method Summary
 java.lang.String getKey()
          Return the key for this object - the String used to find this object within the BeeTree.
 long getMarshalledLength()
          Returns the marshalled length.
 SwappingBuffer getSwappingBuffer()
          Gain direct access to the current SwappingBuffer.
 void marshal(java.io.DataOutputStream dest)
          Marshals - writes as a succession of fields - the object's data onto the supplied stream.
 void preMarshal()
          Prepare to marshal.
 void preUnmarshal()
          Prepare to unmarshal.
 void setKey(java.lang.String key)
          Sets the key for this object.
 void unmarshal(java.io.DataInputStream src)
          De-serialises the object's properties from the supplied input stream.
 
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

BeeGeneric

public BeeGeneric()

BeeGeneric

protected BeeGeneric(BeeTreeCompactor patron)
Method Detail

preMarshal

public void preMarshal()
                throws java.io.IOException
Prepare to marshal.

Overrides:
preMarshal in class BeeObject
Throws:
java.io.IOException - if the object isn't ready.

preUnmarshal

public void preUnmarshal()
                  throws java.io.IOException
Prepare to unmarshal.

Overrides:
preUnmarshal in class BeeObject
Throws:
java.io.IOException - if the object isn't ready.

getKey

public java.lang.String getKey()
Return the key for this object - the String used to find this object within the BeeTree.

Overrides:
getKey in class BeeObject
Returns:
The key.

setKey

public void setKey(java.lang.String key)
Sets the key for this object.

Overrides:
setKey in class BeeObject
Parameters:
key - The full key to this object.

marshal

public void marshal(java.io.DataOutputStream dest)
             throws java.io.IOException
Marshals - writes as a succession of fields - the object's data onto the supplied stream.

Specified by:
marshal in class BeeObject
Parameters:
dest - The stream to write onto.
Throws:
java.io.IOException - if an error occurs.

unmarshal

public void unmarshal(java.io.DataInputStream src)
               throws java.io.IOException
De-serialises the object's properties from the supplied input stream.

Specified by:
unmarshal in class BeeObject
Parameters:
src - the stream to read from.
Throws:
java.io.IOException - if an error occurs.

getMarshalledLength

public long getMarshalledLength()
Returns the marshalled length.

Overrides:
getMarshalledLength in class BeeObject
Returns:
The marshalled length of this object.

getSwappingBuffer

public SwappingBuffer getSwappingBuffer()
Gain direct access to the current SwappingBuffer. Be careful with it; YMMV.

Returns:
The SwappingBuffer.