ostore.cache
Class TestBlock

java.lang.Object
  |
  +--ostore.cache.TestBlock
All Implemented Interfaces:
Cacheable, QuickSerializable

public class TestBlock
extends Object
implements Cacheable

Version:
$ID: TestBlock.java, v 1.0 Class used to create Cacheable objects to test the Cache. This class has a guid, vhash, and a an id (int) used to indicate which block this is.
Author:
Larry H. Tung

Constructor Summary
TestBlock()
          create an empty test block with no guid and vhash.
TestBlock(InputBuffer buffer)
          convert a byte[] into the object byte[] will have the following format: | id | bool haveGuid | guid if haveGuid==true | bool haveVHash | vhash if haveVHash==true
TestBlock(SecureHash guid, SecureHash vhash)
          create a TestBlock with the specified guid and vhash
TestBlock(SecureHash guid, SecureHash vhash, int count)
          create a TestBlock with the specified guid and vhash reset the count (debugging purposes)
 
Method Summary
 SecureHash getDiss()
           
 SecureHash getDissBucket()
           
 SecureHash getGuid()
           
 SecureHash getVHash()
           
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 void setDiss(SecureHash guid)
           
 void setDissBucket(SecureHash guid)
           
 void setGuid(SecureHash guid)
           
 void setVHash(SecureHash vhash)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestBlock

public TestBlock()
create an empty test block with no guid and vhash.


TestBlock

public TestBlock(SecureHash guid,
                 SecureHash vhash)
create a TestBlock with the specified guid and vhash


TestBlock

public TestBlock(SecureHash guid,
                 SecureHash vhash,
                 int count)
create a TestBlock with the specified guid and vhash reset the count (debugging purposes)


TestBlock

public TestBlock(InputBuffer buffer)
          throws QSException
convert a byte[] into the object byte[] will have the following format: | id | bool haveGuid | guid if haveGuid==true | bool haveVHash | vhash if haveVHash==true

Method Detail

getGuid

public SecureHash getGuid()

getVHash

public SecureHash getVHash()

setGuid

public void setGuid(SecureHash guid)

setVHash

public void setVHash(SecureHash vhash)

getDiss

public SecureHash getDiss()

getDissBucket

public SecureHash getDissBucket()

setDiss

public void setDiss(SecureHash guid)

setDissBucket

public void setDissBucket(SecureHash guid)

serialize

public void serialize(OutputBuffer buffer)
Description copied from interface: QuickSerializable
Add the object to the buffer.

Specified by:
serialize in interface QuickSerializable
Parameters:
buffer - the output buffer to add the object to