# Class LineClassFileIterator<T>

java.lang.Object
org.snpeff.fileIterator.FileIterator<T>
org.snpeff.fileIterator.LineClassFileIterator<T>

All Implemented Interfaces:
  `Iterable<T>, Iterator<T>`

Direct Known Subclasses:
  `BlastResultFileIterator, MatrixEntryFileIterator, MicroCosmFileIterator`

public class LineClassFileIterator<T> extends FileIterator<T>
Iterate on each line. Create and populate objects based on 'fieldNames' definition: a colon separated list of fields. Note: You can use empty names to skip columns

Author:
  pcingola

## Field Summary

Fields
Modifier and Type
Field
Description
`protected Class`
`clazz`
`static boolean`
`debug`
`static final char`
`FIELD_NAME_SEPARATOR`
`protected HashMap<String,Field>`
`fieldByName`
`protected String[]`
`fieldNames`
`protected String`
`fieldStr`
`protected String`
`separator`

### Fields inherited from class FileIterator

`autoClose, countNewLineChars, fileName, fileSize, line, lineNum, next, nextLine, reader, verbose`

## Constructor Summary

Constructors
Constructor
Description
`LineClassFileIterator(String fileName, Class clazz)`
`LineClassFileIterator(String fileName, Class clazz, String fieldNames)`

## Method Summary

Modifier and Type
Method
Description
`protected T`
`createObject(String line)`
Create an object using
`protected void`
`fieldMap()`
Map field names to Field objects
`Iterator<T>`
`iterator()`
`protected T`
`readNext()`
Read a sequence from the file
`void`
`setSeparator(String separator)`

### Methods inherited from class FileIterator

`close, countNewLineChars, getFilePointer, getLine, getLineNum, guessNewLineChars, hasNext, hasSeek, init, isDebug, load, next, readLine, ready, remove, seek, setAutoClose, setDebug, setVerbose, toString`

### Methods inherited from class Object

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

### Methods inherited from interface Iterable

`forEach, spliterator`

### Methods inherited from interface Iterator

`forEachRemaining`

## Field Details

### debug

public static boolean debug

### FIELD_NAME_SEPARATOR

public static final char FIELD_NAME_SEPARATOR

See Also:
  - Constant Field Values

### separator

protected String separator

### fieldStr

protected String fieldStr

### fieldNames

protected String[] fieldNames

### fieldByName

protected HashMap<String,Field> fieldByName

### clazz

protected Class clazz

## Constructor Details

### LineClassFileIterator

public LineClassFileIterator(String fileName, Class clazz)

### LineClassFileIterator

public LineClassFileIterator(String fileName, Class clazz, String fieldNames)

## Method Details

### createObject

protected T createObject(String line)
Create an object using

Parameters:
  `line` -
Returns:

### fieldMap

protected void fieldMap()
Map field names to Field objects

### iterator

public Iterator<T> iterator()

Specified by:
  `iterator` in interface `Iterable<T>`
Overrides:
  `iterator` in class `FileIterator<T>`

### readNext

protected T readNext()
Read a sequence from the file

Specified by:
  `readNext` in class `FileIterator<T>`
Returns:

### setSeparator

public void setSeparator(String separator)