org.terrier.structures.collections
Class FSOrderedMapFile.EntryIterator<IK extends org.apache.hadoop.io.Writable,IV extends org.apache.hadoop.io.Writable>

java.lang.Object
  extended by org.terrier.structures.collections.FSOrderedMapFile.EntryIterator<IK,IV>
All Implemented Interfaces:
Closeable, Iterator<Map.Entry<IK,IV>>, Skipable
Enclosing class:
FSOrderedMapFile<K extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable>

public static class FSOrderedMapFile.EntryIterator<IK extends org.apache.hadoop.io.Writable,IV extends org.apache.hadoop.io.Writable>
extends Object
implements Iterator<Map.Entry<IK,IV>>, Closeable, Skipable

an iterator for entries.


Field Summary
protected  int counter
           
protected  DataInput di
           
protected  FixedSizeWriteableFactory<IK> keyFactory
           
protected  int numEntries
           
protected  FixedSizeWriteableFactory<IV> valueFactory
           
 
Constructor Summary
FSOrderedMapFile.EntryIterator(String filename, FixedSizeWriteableFactory<IK> _keyFactory, FixedSizeWriteableFactory<IV> _valueFactory)
          constructor
 
Method Summary
 void close()
          
 boolean hasNext()
          
 Map.Entry<IK,IV> next()
          
 void remove()
          
 void skip(int _numEntries)
          Skip forward the specified number of entries.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

di

protected DataInput di

numEntries

protected int numEntries

counter

protected int counter

keyFactory

protected FixedSizeWriteableFactory<IK extends org.apache.hadoop.io.Writable> keyFactory

valueFactory

protected FixedSizeWriteableFactory<IV extends org.apache.hadoop.io.Writable> valueFactory
Constructor Detail

FSOrderedMapFile.EntryIterator

public FSOrderedMapFile.EntryIterator(String filename,
                                      FixedSizeWriteableFactory<IK> _keyFactory,
                                      FixedSizeWriteableFactory<IV> _valueFactory)
                               throws IOException
constructor

Parameters:
filename -
_keyFactory -
_valueFactory -
Throws:
IOException
Method Detail

close

public void close()
           throws IOException

Specified by:
close in interface Closeable
Throws:
IOException

hasNext

public boolean hasNext()

Specified by:
hasNext in interface Iterator<Map.Entry<IK extends org.apache.hadoop.io.Writable,IV extends org.apache.hadoop.io.Writable>>

next

public Map.Entry<IK,IV> next()

Specified by:
next in interface Iterator<Map.Entry<IK extends org.apache.hadoop.io.Writable,IV extends org.apache.hadoop.io.Writable>>

remove

public void remove()

Specified by:
remove in interface Iterator<Map.Entry<IK extends org.apache.hadoop.io.Writable,IV extends org.apache.hadoop.io.Writable>>

skip

public void skip(int _numEntries)
          throws IOException
Skip forward the specified number of entries. Should be followed by a next() call.

Specified by:
skip in interface Skipable
Parameters:
_numEntries - number of entries to skip
Throws:
IOException - if an IO problem occurs.


Terrier 3.6. Copyright © 2004-2011 University of Glasgow