Class BlockDiskElementDescriptor<K>
java.lang.Object
org.apache.commons.jcs3.auxiliary.disk.block.BlockDiskElementDescriptor<K>
- All Implemented Interfaces:
Externalizable
,Serializable
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
recycle bin.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorBlockDiskElementDescriptor
(K key, int[] blocks) Constructor -
Method Summary
Modifier and TypeMethodDescriptionint[]
This holds the block numbers.getKey()
void
readExternal
(ObjectInput input) Saves on reflection.void
setBlocks
(int[] blocks) void
toString()
For debugging.void
writeExternal
(ObjectOutput output) Saves on reflection.
-
Constructor Details
-
BlockDiskElementDescriptor
public BlockDiskElementDescriptor()Default constructor -
BlockDiskElementDescriptor
Constructor- Parameters:
key
- the keyblocks
- the data- Since:
- 3.1
-
-
Method Details
-
setKey
- Parameters:
key
- The key to set.
-
getKey
- Returns:
- Returns the key.
-
setBlocks
- Parameters:
blocks
- The blocks to set.
-
getBlocks
This holds the block numbers. An item my be dispersed between multiple blocks.- Returns:
- Returns the blocks.
-
toString
For debugging. -
readExternal
Saves on reflection.(non-Javadoc)
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
- See Also:
-
writeExternal
Saves on reflection.(non-Javadoc)
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
- See Also:
-