p2ps.imp.discovery.cache
Class FileIndexTable

java.lang.Object
  extended byp2ps.imp.discovery.cache.FileIndexTable

public class FileIndexTable
extends java.lang.Object

A table of indexes keyed by id

Version:
$Revision: 295 $
Author:
Ian Wang

Field Summary
static int DEFAULT_TABLE_BLOCK_SIZE
           
 
Constructor Summary
FileIndexTable()
           
FileIndexTable(int blocksize)
           
 
Method Summary
 int addIndex(int index)
          Adds an index to the FileIndexTable
 int getIndex(int id)
           
 int removeIndex(int id)
          Removes an index from the FileIndexTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TABLE_BLOCK_SIZE

public static final int DEFAULT_TABLE_BLOCK_SIZE
See Also:
Constant Field Values
Constructor Detail

FileIndexTable

public FileIndexTable()

FileIndexTable

public FileIndexTable(int blocksize)
Method Detail

addIndex

public int addIndex(int index)
Adds an index to the FileIndexTable

Returns:
an id for the index

getIndex

public int getIndex(int id)
Returns:
the index at the specified id, or -1 if deleted/doesn't exist

removeIndex

public int removeIndex(int id)
Removes an index from the FileIndexTable

Returns:
the index at the specified id, or -1 if deleted/doesn't exist