# Interface SamReader.Indexing

All Known Implementing Classes:
  `CRAMFileReader, SamReader.PrimitiveSamReaderToSamReaderAdapter`

Enclosing interface:
  `SamReader`

public static interface SamReader.Indexing
Facet for index-related operations.

## Method Summary

Modifier and Type
Method
Description
`BrowseableBAMIndex`
`getBrowseableIndex()`
Gets an index tagged with the BrowseableBAMIndex interface.
`SAMFileSpan`
`getFilePointerSpanningReads()`
Gets a pointer spanning all reads in the BAM file.
`BAMIndex`
`getIndex()`
Retrieves the index for the given file type.
`boolean`
`hasBrowseableIndex()`
Returns true if the supported index is browseable, meaning the bins in it can be traversed and chunk data inspected and retrieved.
`SAMRecordIterator`
`iterator(SAMFileSpan chunks)`
Iterate through the given chunks in the file.

## Method Details

### getIndex

BAMIndex getIndex()
Retrieves the index for the given file type. Ensure that the index is of the specified type.

Returns:
  An index of the given type.

### hasBrowseableIndex

boolean hasBrowseableIndex()
Returns true if the supported index is browseable, meaning the bins in it can be traversed and chunk data inspected and retrieved.

Returns:
  True if the index supports the BrowseableBAMIndex interface. False otherwise.

### getBrowseableIndex

BrowseableBAMIndex getBrowseableIndex()
Gets an index tagged with the BrowseableBAMIndex interface. Throws an exception if no such index is available.

Returns:
  An index with a browseable interface, if possible.
Throws:
  `SAMException` - if no such index is available.

### iterator

SAMRecordIterator iterator(SAMFileSpan chunks)
Iterate through the given chunks in the file.

Parameters:
  `chunks` - List of chunks for which to retrieve data.
Returns:
  An iterator over the given chunks.

### getFilePointerSpanningReads

SAMFileSpan getFilePointerSpanningReads()
Gets a pointer spanning all reads in the BAM file.

Returns:
  Unbounded pointer to the first record, in chunk format.