org.egothor.core
Class IListShadow

java.lang.Object
  extended by org.egothor.core.IListShadow
All Implemented Interfaces:
IListItem, IListReader
Direct Known Subclasses:
IListRemapper, IListWasher

public class IListShadow
extends java.lang.Object
implements IListReader

A IListShadow envelopes underlaying inverted list. You can also use last field to access the last object returned via next().

IListReader assumes that none will overwrite the return value of IListReader.next() and IListReader.skipTo(long). Moreover, the shadow ensures that the return value will be always the same object unless we reach the end of the list.

Author:
Leo Galambos

Constructor Summary
IListShadow()
          Constructor for the IListWasher object
 
Method Summary
 void close()
          Close the IListWasher's IListReader.
 long getPostings()
          Return the length of the inverted list.
 java.lang.String getTerm()
          Return the term for which the inverted list was constructed.
 boolean next()
          Go to the next element in the inverted list.
 Proximities openProx()
          Return an access object to the proximity list.
 void setSource(IListReader source)
          Sets the source attribute of the IListWasher object
 boolean skipTo(long uid)
          Go to the specified document.
 long uid()
          Identification of the document.
 int weight()
          Calculated vector value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IListShadow

public IListShadow()
Constructor for the IListWasher object

Method Detail

setSource

public void setSource(IListReader source)
Sets the source attribute of the IListWasher object

Parameters:
source - The new source value

getPostings

public long getPostings()
Return the length of the inverted list.

Specified by:
getPostings in interface IListReader
Returns:
the length of the inverted list

getTerm

public java.lang.String getTerm()
Return the term for which the inverted list was constructed.

Specified by:
getTerm in interface IListReader
Returns:
the term owning the inverted list

close

public void close()
Close the IListWasher's IListReader.

Specified by:
close in interface IListReader

skipTo

public boolean skipTo(long uid)
Go to the specified document.

Specified by:
skipTo in interface IListReader
Parameters:
uid - the document to skip to
Returns:
the item

next

public boolean next()
Go to the next element in the inverted list. If the list does not exist the method returns without executing.

Specified by:
next in interface IListReader
Returns:
the item

openProx

public Proximities openProx()
Description copied from interface: IListItem
Return an access object to the proximity list.

Specified by:
openProx in interface IListItem
Returns:
a Proximities object

uid

public long uid()
Description copied from interface: IListItem
Identification of the document. If this value is lower than 0, then this item ought to be supposed to be invalid.

Specified by:
uid in interface IListItem

weight

public int weight()
Description copied from interface: IListItem
Calculated vector value.

Specified by:
weight in interface IListItem