org.apache.nutch.io
Class SetFile.Reader

java.lang.Object
  extended byorg.apache.nutch.io.MapFile.Reader
      extended byorg.apache.nutch.io.SetFile.Reader
Enclosing class:
SetFile

public static class SetFile.Reader
extends MapFile.Reader

Provide access to an existing set file.


Constructor Summary
SetFile.Reader(NutchFileSystem nfs, String dirName)
          Construct a set reader for the named set.
SetFile.Reader(NutchFileSystem nfs, String dirName, WritableComparator comparator)
          Construct a set reader for the named set using the named comparator.
 
Method Summary
 WritableComparable get(WritableComparable key)
          Read the matching key from a set into key.
 boolean next(WritableComparable key)
          Read the next key in a set into key.
 boolean seek(WritableComparable key)
          Positions the reader at the named key, or if none such exists, at the first entry after the named key.
 
Methods inherited from class org.apache.nutch.io.MapFile.Reader
close, finalKey, get, getKeyClass, getValueClass, next, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetFile.Reader

public SetFile.Reader(NutchFileSystem nfs,
                      String dirName)
               throws IOException
Construct a set reader for the named set.


SetFile.Reader

public SetFile.Reader(NutchFileSystem nfs,
                      String dirName,
                      WritableComparator comparator)
               throws IOException
Construct a set reader for the named set using the named comparator.

Method Detail

seek

public boolean seek(WritableComparable key)
             throws IOException
Description copied from class: MapFile.Reader
Positions the reader at the named key, or if none such exists, at the first entry after the named key. Returns true iff the named key exists in this map.

Overrides:
seek in class MapFile.Reader
Throws:
IOException

next

public boolean next(WritableComparable key)
             throws IOException
Read the next key in a set into key. Returns true if such a key exists and false when at the end of the set.

Throws:
IOException

get

public WritableComparable get(WritableComparable key)
                       throws IOException
Read the matching key from a set into key. Returns key, or null if no match exists.

Throws:
IOException


Copyright © 2006 The Apache Software Foundation