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

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

public class BlockDiskElementDescriptor
extends java.lang.Object
implements java.io.Serializable, java.io.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.
 java.io.Serializable getKey()
           
 void readExternal(java.io.ObjectInput input)
          Saves on reflection.
 void setBlocks(int[] blocks)
           
 void setKey(java.io.Serializable key)
           
 java.lang.String toString()
          For debugging.
 void writeExternal(java.io.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(java.io.Serializable key)
Parameters:
key - The key to set.

getKey

public java.io.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 java.lang.String toString()
For debugging.

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

readExternal

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

(non-Javadoc)

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

writeExternal

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

(non-Javadoc)

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


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