org.basex.index
Class IndexCache

java.lang.Object
  extended by org.basex.index.IndexCache

public final class IndexCache
extends java.lang.Object

This class caches sizes and pointers from index results.

Author:
BaseX Team 2005-12, BSD License, Dimitar Popov

Constructor Summary
IndexCache()
           
 
Method Summary
 IndexEntry add(byte[] key, int s, long p)
          Adds a new cache entry.
 void delete(byte[] key)
          Deletes a cached entry.
 IndexEntry get(byte[] key)
          Gets cached entry for the specified key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexCache

public IndexCache()
Method Detail

get

public IndexEntry get(byte[] key)
Gets cached entry for the specified key.

Parameters:
key - key
Returns:
cached entry or null if the entry is stale

add

public IndexEntry add(byte[] key,
                      int s,
                      long p)
Adds a new cache entry. If an entry with the specified key already exists, it will be updated.

Parameters:
key - key
s - number of index hits
p - pointer to id list
Returns:
cache entry

delete

public void delete(byte[] key)
Deletes a cached entry.

Parameters:
key - key