org.tranche.flatfile
Class DataBlockCacheEntry

java.lang.Object
  extended by org.tranche.flatfile.DataBlockCacheEntry

public class DataBlockCacheEntry
extends java.lang.Object

An individual entry in the DataBlockUtil cache, which can be turned on and off.

Author:
Bryan Smith - bryanesmith@gmail.com

Field Summary
protected  BigHash chunkHash
          The hash representing the data chunk.
protected  DataBlock dataBlock
          Which DataBlock contains the chunk.
protected  int offset
          The offset, in bytes, of where the chunk exists in the DataBlock.
protected  int size
          The size, in bytes, of the chunk.
 
Method Summary
static DataBlockCacheEntry create(BigHash chunkHash, DataBlock dataBlock, int offset, int size)
          Create an entry for the cache.
 boolean equals(java.lang.Object h)
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chunkHash

protected final BigHash chunkHash

The hash representing the data chunk.


dataBlock

protected final DataBlock dataBlock

Which DataBlock contains the chunk.


offset

protected final int offset

The offset, in bytes, of where the chunk exists in the DataBlock.


size

protected final int size

The size, in bytes, of the chunk.

Method Detail

create

public static DataBlockCacheEntry create(BigHash chunkHash,
                                         DataBlock dataBlock,
                                         int offset,
                                         int size)

Create an entry for the cache.

Parameters:
chunkHash -
dataBlock -
offset - Offset of chunk in payload of DataBlock
Returns:

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object h)
Overrides:
equals in class java.lang.Object


This code is free for use both commercially and non-commercially as stated in the project's license