# Class AbstractRecordAndOffset

java.lang.Object
htsjdk.samtools.util.AbstractRecordAndOffset

Direct Known Subclasses:
  `EdgingRecordAndOffset, SamLocusIterator.RecordAndOffset`

public class AbstractRecordAndOffset extends Object
Holds a SAMRecord plus the zero-based offset into that SAMRecord's bases and quality scores that corresponds to the base and quality at the genomic position described the containing AbstractLocusInfo. One object represents one base for `SamLocusIterator.RecordAndOffset` implementation or one alignment block of `SAMRecord` for `TypedRecordAndOffset` implementation.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`AbstractRecordAndOffset.AlignmentType`
Classifies whether the given event is a match, insertion, or deletion.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final AbstractRecordAndOffset.AlignmentType`
`alignmentType`
The `AbstractRecordAndOffset.AlignmentType` of this object, which classifies whether the given event is a match, insertion, or deletion when queried from a `SamLocusIterator`.
`protected final int`
`offset`
Zero-based offset in the read corresponding to the current position in AbstractLocusInfo
`protected final SAMRecord`
`record`
A SAMRecord aligned to reference position

## Constructor Summary

Constructors
Constructor
Description
`AbstractRecordAndOffset(SAMRecord record, int offset)`
`AbstractRecordAndOffset(SAMRecord record, int offset, AbstractRecordAndOffset.AlignmentType alignmentType)`

## Method Summary

Modifier and Type
Method
Description
`AbstractRecordAndOffset.AlignmentType`
`getAlignmentType()`
The `AbstractRecordAndOffset.AlignmentType` of this object, which classifies whether the given event is a match, insertion, or deletion when queried from a `SamLocusIterator`.
`byte[]`
`getBaseQualities()`
`byte`
`getBaseQuality()`
`int`
`getLength()`
`int`
`getOffset()`
`byte`
`getReadBase()`
`String`
`getReadName()`
`SAMRecord`
`getRecord()`
`protected void`
`validateOffset(int offset, byte[] array)`

### Methods inherited from class Object

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

## Field Details

### record

protected final SAMRecord record
A SAMRecord aligned to reference position

### offset

protected final int offset
Zero-based offset in the read corresponding to the current position in AbstractLocusInfo

### alignmentType

protected final AbstractRecordAndOffset.AlignmentType alignmentType
The `AbstractRecordAndOffset.AlignmentType` of this object, which classifies whether the given event is a match, insertion, or deletion when queried from a `SamLocusIterator`.

## Constructor Details

### AbstractRecordAndOffset

public AbstractRecordAndOffset(SAMRecord record, int offset)

Parameters:
  `record` - inner SAMRecord
  `offset` - from the start of the read

### AbstractRecordAndOffset

public AbstractRecordAndOffset(SAMRecord record, int offset, AbstractRecordAndOffset.AlignmentType alignmentType)

Parameters:
  `record` - inner SAMRecord
  `offset` - from the start of the read
  `alignmentType` - The `AbstractRecordAndOffset.AlignmentType` of this object, which is used when queried in a `SamLocusIterator`.

## Method Details

### getOffset

public int getOffset()

Returns:
  offset of aligned read base from the start of the read.

### getRecord

public SAMRecord getRecord()

Returns:
  inner `SAMRecord` object.

### getAlignmentType

public AbstractRecordAndOffset.AlignmentType getAlignmentType()
The `AbstractRecordAndOffset.AlignmentType` of this object, which classifies whether the given event is a match, insertion, or deletion when queried from a `SamLocusIterator`.

### getReadBase

public byte getReadBase()

Returns:
  the read base according to `offset`.

### getLength

public int getLength()

Returns:
  the length of alignment block represented by the object.

### getReadName

public String getReadName()

Returns:
  read name of inner SAMRecord.

### getBaseQualities

public byte[] getBaseQualities()

Returns:
  array of base qualities of inner SAMRecord.

### getBaseQuality

public byte getBaseQuality()

Returns:
  the base quality according to `offset`.

### validateOffset

protected void validateOffset(int offset, byte[] array)