## org.apache.mahout.common.iterator
Class FileLineIterable

    java.lang.Object
      org.apache.mahout.common.iterator.FileLineIterable

All Implemented Interfaces:
  Iterable<String>

    public final class FileLineIterable

extends Object
implements Iterable<String>

Iterable representing the lines of a text file. It can produce an `Iterator` over those lines. This assumes the text file's lines are delimited in a manner consistent with how `BufferedReader` defines lines.

Constructor Summary
`FileLineIterable(File file)` Creates a `FileLineIterable` over a given file, assuming a UTF-8 encoding.
`FileLineIterable(File file, boolean skipFirstLine)` Creates a `FileLineIterable` over a given file, assuming a UTF-8 encoding.
`FileLineIterable(File file, Charset encoding, boolean skipFirstLine)` Creates a `FileLineIterable` over a given file, using the given encoding.
`FileLineIterable(InputStream is)`
`FileLineIterable(InputStream is, boolean skipFirstLine)`
`FileLineIterable(InputStream is, Charset encoding, boolean skipFirstLine)`
`FileLineIterable(InputStream is, Charset encoding, boolean skipFirstLine, String filename)`

Method Summary
`Iterator<String>` `iterator()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### FileLineIterable

    public FileLineIterable(File file)
                     throws IOException

  Creates a `FileLineIterable` over a given file, assuming a UTF-8 encoding.

  Throws:
    `IOException`

### FileLineIterable

    public FileLineIterable(File file,
                            boolean skipFirstLine)
                     throws IOException

  Creates a `FileLineIterable` over a given file, assuming a UTF-8 encoding.

  Throws:
    `IOException`

### FileLineIterable

    public FileLineIterable(File file,
                            Charset encoding,
                            boolean skipFirstLine)
                     throws IOException

  Creates a `FileLineIterable` over a given file, using the given encoding.

  Throws:
    `IOException`

### FileLineIterable

    public FileLineIterable(InputStream is)

### FileLineIterable

    public FileLineIterable(InputStream is,
                            boolean skipFirstLine)

### FileLineIterable

    public FileLineIterable(InputStream is,
                            Charset encoding,
                            boolean skipFirstLine)

### FileLineIterable

    public FileLineIterable(InputStream is,
                            Charset encoding,
                            boolean skipFirstLine,
                            String filename)

Method Detail

### iterator

    public Iterator<String> iterator()

  Specified by:
    `iterator` in interface `Iterable<String>`

Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.