org.egothor.store
Class ProximitiesFileIn

java.lang.Object
  extended by org.egothor.store.ProximitiesFileIn
All Implemented Interfaces:
Proximities

public class ProximitiesFileIn
extends java.lang.Object
implements Proximities

The ProximitiesFileIn object reads the term proximities from a file. The proximities are read by BitInputStream coding methods.

Author:
Leo Galambos

Constructor Summary
ProximitiesFileIn(java.lang.String filename)
          Constructor for the ProximitiesFileIn object.
 
Method Summary
 void close()
          Close this file.
 void closeProx()
          Close this list and release resources.
protected  void finalize()
           
 int leftProx()
          Return the length of the proximities inverted list.
 Proximities open(long offset)
           
 int readProx()
          Read the proximities inverted list.
 int readProx(int[] prox, int offset, int len)
          Read an inverted list of length greater than 1.
 void rewind()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProximitiesFileIn

public ProximitiesFileIn(java.lang.String filename)
                  throws java.io.IOException
Constructor for the ProximitiesFileIn object.

Parameters:
filename - the file holding the proximities
Throws:
java.io.IOException
Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

closeProx

public void closeProx()
Description copied from interface: Proximities
Close this list and release resources.

Specified by:
closeProx in interface Proximities

close

public void close()
           throws java.io.IOException
Close this file.

Throws:
java.io.IOException

rewind

public void rewind()
            throws java.io.IOException
Throws:
java.io.IOException

open

public Proximities open(long offset)
                 throws java.io.IOException
Throws:
java.io.IOException

readProx

public int readProx()
             throws java.io.IOException
Read the proximities inverted list. This is used if the invered list is of length 1.

Specified by:
readProx in interface Proximities
Returns:
the position in the list of the value read
Throws:
java.io.IOException

leftProx

public int leftProx()
Return the length of the proximities inverted list.

Specified by:
leftProx in interface Proximities
Returns:
the length

readProx

public int readProx(int[] prox,
                    int offset,
                    int len)
             throws java.io.IOException
Description copied from interface: Proximities
Read an inverted list of length greater than 1. The list will be read in blocks of the specified size.

Specified by:
readProx in interface Proximities
Parameters:
prox - the buffer
offset - first cell to fill
len - how many cell are read
Returns:
how many cells were read
Throws:
java.io.IOException