it.unimi.dsi.sux4j.io
Class FileLinesList.FileLinesIterator

java.lang.Object
  extended by it.unimi.dsi.fastutil.objects.AbstractObjectIterator<K>
      extended by it.unimi.dsi.fastutil.objects.AbstractObjectBidirectionalIterator<K>
          extended by it.unimi.dsi.fastutil.objects.AbstractObjectListIterator<MutableString>
              extended by it.unimi.dsi.sux4j.io.FileLinesList.FileLinesIterator
All Implemented Interfaces:
BidirectionalIterator<MutableString>, ObjectBidirectionalIterator<MutableString>, ObjectIterator<MutableString>, ObjectListIterator<MutableString>, SafelyCloseable, Closeable, Iterator<MutableString>, ListIterator<MutableString>
Enclosing class:
FileLinesList

public static final class FileLinesList.FileLinesIterator
extends AbstractObjectListIterator<MutableString>
implements SafelyCloseable

An iterator over the lines of a FileLinesList. Instances of this class open an InputStream, and thus should be closed after usage. A “safety-net” finaliser tries to take care of the cases in which closing an instance is impossible.


Constructor Summary
protected FileLinesList.FileLinesIterator(FileLinesList fileLinesList, int index, FastBufferedInputStream inputStream, CharsetDecoder decoder, ByteBuffer byteBuffer, CharBuffer charBuffer)
           
 
Method Summary
 void close()
           
protected  void finalize()
           
 boolean hasNext()
           
 boolean hasPrevious()
           
 MutableString next()
           
 int nextIndex()
           
 MutableString previous()
           
 int previousIndex()
           
 
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObjectListIterator
add, set
 
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObjectBidirectionalIterator
back
 
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObjectIterator
remove, skip
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.ListIterator
remove
 
Methods inherited from interface it.unimi.dsi.fastutil.objects.ObjectBidirectionalIterator
back
 
Methods inherited from interface it.unimi.dsi.fastutil.objects.ObjectIterator
skip
 

Constructor Detail

FileLinesList.FileLinesIterator

protected FileLinesList.FileLinesIterator(FileLinesList fileLinesList,
                                          int index,
                                          FastBufferedInputStream inputStream,
                                          CharsetDecoder decoder,
                                          ByteBuffer byteBuffer,
                                          CharBuffer charBuffer)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<MutableString>
Specified by:
hasNext in interface ListIterator<MutableString>

hasPrevious

public boolean hasPrevious()
Specified by:
hasPrevious in interface BidirectionalIterator<MutableString>
Specified by:
hasPrevious in interface ListIterator<MutableString>

next

public MutableString next()
Specified by:
next in interface Iterator<MutableString>
Specified by:
next in interface ListIterator<MutableString>

previous

public MutableString previous()
Specified by:
previous in interface BidirectionalIterator<MutableString>
Specified by:
previous in interface ListIterator<MutableString>

nextIndex

public int nextIndex()
Specified by:
nextIndex in interface ListIterator<MutableString>

previousIndex

public int previousIndex()
Specified by:
previousIndex in interface ListIterator<MutableString>

close

public void close()
Specified by:
close in interface Closeable

finalize

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