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:
java.io.Closeable, java.util.Iterator<java.util.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 java.lang.Object
implements java.util.Iterator<java.util.Map.Entry<IK,IV>>, java.io.Closeable, Skipable

an iterator for entries.


Field Summary
protected  int counter
           
protected  java.io.DataInput di
           
protected  FixedSizeWriteableFactory<IK> keyFactory
           
protected  int numEntries
           
protected  FixedSizeWriteableFactory<IV> valueFactory
           
 
Constructor Summary
FSOrderedMapFile.EntryIterator(java.lang.String filename, FixedSizeWriteableFactory<IK> _keyFactory, FixedSizeWriteableFactory<IV> _valueFactory)
          constructor
 
Method Summary
 void close()
          
 boolean hasNext()
          
 java.util.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 java.io.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(java.lang.String filename,
                                      FixedSizeWriteableFactory<IK> _keyFactory,
                                      FixedSizeWriteableFactory<IV> _valueFactory)
                               throws java.io.IOException
constructor

Parameters:
filename -
_keyFactory -
_valueFactory -
Throws:
java.io.IOException
Method Detail

close

public void close()
           throws java.io.IOException

Specified by:
close in interface java.io.Closeable
Throws:
java.io.IOException

hasNext

public boolean hasNext()

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

next

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

Specified by:
next in interface java.util.Iterator<java.util.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 java.util.Iterator<java.util.Map.Entry<IK extends org.apache.hadoop.io.Writable,IV extends org.apache.hadoop.io.Writable>>

skip

public void skip(int _numEntries)
          throws java.io.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:
java.io.IOException - if an IO problem occurs.


Terrier 3.5. Copyright © 2004-2011 University of Glasgow