org.egothor.cache
Class CachedIListReader

java.lang.Object
  extended by org.egothor.cache.CachedIListReader
All Implemented Interfaces:
IListItem, IListReader

public class CachedIListReader
extends java.lang.Object
implements IListReader

Represents a IListReader implementation that uses a cache to retrieve posting lists.


Constructor Summary
CachedIListReader(CachedRider cachedBarrel, Barrel barrel, java.lang.String term, int pageSize)
          Constructor for the CachedIListReader object.
 
Method Summary
 void close()
          Closes this reader.
 long getPostings()
          Returns the number of items in the inverted list this object reads (including removed ones).
 java.lang.String getTerm()
          Returns the term that owns this inverted list.
 boolean next()
          Move to the next item in the inverted list.
 Proximities openProx()
          Returns an access object to the proximity list.
 boolean skipTo(long uid)
          Skips (forward) in the inverted list to the first item with an ID greater than or equal to the given uid identification.
 long uid()
          Returns the UID of the current document;
 int weight()
          Returns the weight of the document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedIListReader

public CachedIListReader(CachedRider cachedBarrel,
                         Barrel barrel,
                         java.lang.String term,
                         int pageSize)
Constructor for the CachedIListReader object.

Parameters:
cachedBarrel - cache used to retrieve inverted list pages
barrel - original barrel that stores the non-cached inverted list
term - term that owns this inverted list
pageSize - size of single cached inverted list partition
Method Detail

next

public boolean next()
Move to the next item in the inverted list.

Specified by:
next in interface IListReader
Returns:
true if the next item exists, false otherwise

skipTo

public boolean skipTo(long uid)
Skips (forward) in the inverted list to the first item with an ID greater than or equal to the given uid identification.

Specified by:
skipTo in interface IListReader
Parameters:
uid - the item to skip to
Returns:
true if the next item exists, false otherwise

uid

public long uid()
Returns the UID of the current document;

Specified by:
uid in interface IListItem
Returns:
uid of the current document

weight

public int weight()
Returns the weight of the document.

Specified by:
weight in interface IListItem
Returns:
weight of the document

openProx

public Proximities openProx()
Returns an access object to the proximity list.

Specified by:
openProx in interface IListItem
Returns:
Proximities object

getPostings

public long getPostings()
Returns the number of items in the inverted list this object reads (including removed ones).

Specified by:
getPostings in interface IListReader
Returns:
the number of items

getTerm

public java.lang.String getTerm()
Returns the term that owns this inverted list.

Specified by:
getTerm in interface IListReader
Returns:
term that owns this inverted list

close

public void close()
Closes this reader.

Specified by:
close in interface IListReader