# Class SamFileIterator

java.lang.Object
org.snpeff.fileIterator.FileIterator<SamEntry>
org.snpeff.fileIterator.SamFileIterator

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

public class SamFileIterator extends FileIterator<SamEntry>
Reads a SAM file Note: This is a very 'rustic' reader (we should use Picard's API instead)

Author:
  pcingola

## Field Summary

Fields
Modifier and Type
Field
Description
`static boolean`
`debug`

### Fields inherited from class FileIterator

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

## Constructor Summary

Constructors
Constructor
Description
`SamFileIterator(String samFileName)`

## Method Summary

Modifier and Type
Method
Description
`SamHeader`
`getHeaders()`
`Iterator<SamEntry>`
`iterator()`
`protected SamEntry`
`readNext()`
Read a sequence from the file

### 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

## Constructor Details

### SamFileIterator

public SamFileIterator(String samFileName)

## Method Details

### getHeaders

public SamHeader getHeaders()

### iterator

public Iterator<SamEntry> iterator()

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

### readNext

protected SamEntry readNext()
Read a sequence from the file

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