org.apache.jcs.auxiliary.disk.block
Class BlockDiskElementDescriptor

java.lang.Object
  extended by org.apache.jcs.auxiliary.disk.block.BlockDiskElementDescriptor
All Implemented Interfaces:
Externalizable, Serializable

public class BlockDiskElementDescriptor
extends Object
implements Serializable, Externalizable

This represents an element on disk. This is used when we persist the keys. We only store the block addresses in memory. We don't need the length here, since all the blocks are the same size receyle bin.

Author:
Aaron Smuts
See Also:
Serialized Form

Constructor Summary
BlockDiskElementDescriptor()
           
 
Method Summary
 int[] getBlocks()
          This holds the block numbers.
 Serializable getKey()
           
 void readExternal(ObjectInput input)
          Saves on reflection.
 void setBlocks(int[] blocks)
           
 void setKey(Serializable key)
           
 String toString()
          For debugging.
 void writeExternal(ObjectOutput output)
          Saves on reflection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BlockDiskElementDescriptor

public BlockDiskElementDescriptor()
Method Detail

setKey

public void setKey(Serializable key)
Parameters:
key - The key to set.

getKey

public Serializable getKey()
Returns:
Returns the key.

setBlocks

public void setBlocks(int[] blocks)
Parameters:
blocks - The blocks to set.

getBlocks

public int[] getBlocks()
This holds the block numbers. An item my be dispersed between multiple blocks.

Returns:
Returns the blocks.

toString

public String toString()
For debugging.

Overrides:
toString in class Object
Returns:
Info on the descriptor.

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Saves on reflection.

(non-Javadoc)

Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException
See Also:
Externalizable.readExternal(java.io.ObjectInput)

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Saves on reflection.

(non-Javadoc)

Specified by:
writeExternal in interface Externalizable
Throws:
IOException
See Also:
Externalizable.writeExternal(java.io.ObjectOutput)


Copyright © 2002-2012 Apache Software Foundation. All Rights Reserved.