# Class ReferenceSequenceFileWalker

java.lang.Object
htsjdk.samtools.reference.ReferenceSequenceFileWalker

All Implemented Interfaces:
  `Closeable, AutoCloseable`

public class ReferenceSequenceFileWalker extends Object implements Closeable
Manages a ReferenceSequenceFile. Loads the requested sequence, ensuring that access is in order, and confirming that sequence name and index agree.

## Constructor Summary

Constructors
Constructor
Description
`ReferenceSequenceFileWalker(ReferenceSequenceFile referenceSequenceFile)`
`ReferenceSequenceFileWalker(File file)`
`ReferenceSequenceFileWalker(Path path)`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`ReferenceSequence`
`get(int sequenceIndex)`
Get reference sequence without validating name or length.
`ReferenceSequence`
`get(int sequenceIndex, String sequenceName, int length)`
Ensure that the requested sequence is loaded.
`SAMSequenceDictionary`
`getSequenceDictionary()`

### Methods inherited from class Object

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

## Constructor Details

### ReferenceSequenceFileWalker

public ReferenceSequenceFileWalker(ReferenceSequenceFile referenceSequenceFile)

### ReferenceSequenceFileWalker

public ReferenceSequenceFileWalker(Path path)

### ReferenceSequenceFileWalker

public ReferenceSequenceFileWalker(File file)

## Method Details

### get

public ReferenceSequence get(int sequenceIndex, String sequenceName, int length)
Ensure that the requested sequence is loaded. Throws an exception if out-of-order request is made, or if there is a mismatch between the requested name and the name found in the ReferenceSequenceFile

### get

public ReferenceSequence get(int sequenceIndex)
Get reference sequence without validating name or length. This is OK if the entire sequence dictionary was validated before reading sequences.

### getSequenceDictionary

public SAMSequenceDictionary getSequenceDictionary()

### close

public void close() throws IOException

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Throws:
  `IOException`