Package lazyj

Class FileLinesIterator

java.lang.Object
lazyj.FileLinesIterator
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable, java.util.Iterator<java.lang.String>

public class FileLinesIterator
extends java.lang.Object
implements java.util.Iterator<java.lang.String>, java.io.Closeable
Iterator over the lines in a buffer
Author:
costing
  • Constructor Summary

    Constructors 
    Constructor Description
    FileLinesIterator​(java.io.BufferedReader br)
    Iterate over the lines in this bufferedReader
  • Method Summary

    Modifier and Type Method Description
    void close()  
    boolean hasNext()  
    java.lang.String next()  
    void remove()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.Iterator

    forEachRemaining
  • Constructor Details

    • FileLinesIterator

      public FileLinesIterator​(java.io.BufferedReader br)
      Iterate over the lines in this bufferedReader
      Parameters:
      br -
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface java.util.Iterator<java.lang.String>
    • next

      public java.lang.String next()
      Specified by:
      next in interface java.util.Iterator<java.lang.String>
    • remove

      public void remove()
      Specified by:
      remove in interface java.util.Iterator<java.lang.String>
    • close

      public void close() throws java.io.IOException
      Specified by:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in interface java.io.Closeable
      Throws:
      java.io.IOException