Package xyz.cofe.text

Class LineReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Iterable<java.lang.String>

    public class LineReader
    extends java.lang.Object
    implements java.lang.Iterable<java.lang.String>, java.io.Closeable
    Построчный итератор
    Author:
    nt.gocha@gmail.com
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int bufferSize  
      protected java.util.concurrent.locks.Lock lock  
      protected java.io.Reader reader  
    • Constructor Summary

      Constructors 
      Constructor Description
      LineReader​(java.io.Reader reader)  
      LineReader​(java.io.Reader reader, int bufferSize, java.util.concurrent.locks.Lock lock)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      protected void finalize()  
      java.util.Iterator<java.lang.String> iterator()  
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Field Detail

      • reader

        protected java.io.Reader reader
      • bufferSize

        protected int bufferSize
      • lock

        protected final java.util.concurrent.locks.Lock lock
    • Constructor Detail

      • LineReader

        public LineReader​(java.io.Reader reader)
      • LineReader

        public LineReader​(java.io.Reader reader,
                          int bufferSize,
                          java.util.concurrent.locks.Lock lock)
    • Method Detail

      • iterator

        public java.util.Iterator<java.lang.String> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<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
      • finalize

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