Class FileIterable

  • All Implemented Interfaces:
    java.lang.Iterable<java.lang.String>

    public class FileIterable
    extends java.lang.Object
    implements java.lang.Iterable<java.lang.String>

    Handy class to easily iterate over a file, line by line, using a Java 5 for loop.

    Author:
    Romain Pelisse <[email protected]>
    • Constructor Summary

      Constructors 
      Constructor Description
      FileIterable​(java.io.File file)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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
    • Constructor Detail

      • FileIterable

        public FileIterable​(java.io.File file)
    • Method Detail

      • finalize

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

        public java.util.Iterator<java.lang.String> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.String>