Package htsjdk.samtools

# Class LinearIndex

java.lang.Object
htsjdk.samtools.LinearIndex

public class LinearIndex extends Object
The linear index associated with a given reference in a BAM index.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`BAM_LIDX_SHIFT`
`static final int`
`MAX_LINEAR_INDEX_SIZE`

## Constructor Summary

Constructors
Constructor
Description
`LinearIndex(int referenceSequence, int indexStart, long[] indexEntries)`

## Method Summary

Modifier and Type
Method
Description
`static int`
`convertToLinearIndexOffset(int contigPos)`
`boolean`
`equals(Object o)`
`long`
`get(int index)`
`long[]`
`getIndexEntries()`
Direct access to the array.
`int`
`getIndexStart()`
`long`
`getMinimumOffset(int startPos)`
Gets the minimum offset of any alignment start appearing in this index, according to the linear index.
`int`
`getReferenceSequence()`
`int`
`hashCode()`
`int`
`size()`

### Methods inherited from class java.lang.Object

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

## Field Details

### MAX_LINEAR_INDEX_SIZE

public static final int MAX_LINEAR_INDEX_SIZE

### BAM_LIDX_SHIFT

public static final int BAM_LIDX_SHIFT

See Also:
  - Constant Field Values

## Constructor Details

### LinearIndex

public LinearIndex(int referenceSequence, int indexStart, long[] indexEntries)

## Method Details

### getReferenceSequence

public int getReferenceSequence()

### size

public int size()

### get

public long get(int index)

### convertToLinearIndexOffset

public static int convertToLinearIndexOffset(int contigPos)

### getMinimumOffset

public long getMinimumOffset(int startPos)
Gets the minimum offset of any alignment start appearing in this index, according to the linear index.

Parameters:
  `startPos` - Starting position for this query.
Returns:
  The minimum offset, in chunk format, of any read appearing in this position.

### getIndexEntries

public long[] getIndexEntries()
Direct access to the array. Be careful!

Returns:
  The elements of the linear index.

### getIndexStart

public int getIndexStart()

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`