# Class SamLocusIterator.LocusInfo

java.lang.Object
htsjdk.samtools.util.AbstractLocusInfo<SamLocusIterator.RecordAndOffset>
htsjdk.samtools.util.SamLocusIterator.LocusInfo

All Implemented Interfaces:
  `Locatable, Locus`

Enclosing class:
  `SamLocusIterator`

public static final class SamLocusIterator.LocusInfo extends AbstractLocusInfo<SamLocusIterator.RecordAndOffset>
The unit of iteration. Holds information about the locus (the SAMSequenceRecord and 1-based position on the reference), plus List of ReadAndOffset objects, one for each read that overlaps the locus; two more List_s_ of ReadAndOffset objects include reads that overlap the locus with insertions and deletions respectively

## Constructor Summary

Constructors
Constructor
Description
`LocusInfo(SAMSequenceRecord referenceSequence, int position)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addDeleted(SAMRecord read, int previousPosition)`
Accumulate info for one read with a deletion
`void`
`addInserted(SAMRecord read, int firstPosition)`
Accumulate info for one read with an insertion.
`List<SamLocusIterator.RecordAndOffset>`
`getDeletedInRecord()`
`List<SamLocusIterator.RecordAndOffset>`
`getInsertedInRecord()`
`boolean`
`isEmpty()`
`int`
`size()`

### Methods inherited from class AbstractLocusInfo

`add, getContig, getEnd, getPosition, getRecordAndOffsets, getRecordAndPositions, getSequenceIndex, getSequenceLength, getSequenceName, getStart, toString`

### Methods inherited from class Object

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

### Methods inherited from interface Locatable

`contains, contigsMatch, getLengthOnReference, overlaps, withinDistanceOf`

## Constructor Details

### LocusInfo

public LocusInfo(SAMSequenceRecord referenceSequence, int position)

Parameters:
  `referenceSequence` - reference sequence at which the reads are aligned
  `position` - position in the sequence at which the reads are aligned

## Method Details

### addDeleted

public void addDeleted(SAMRecord read, int previousPosition)
Accumulate info for one read with a deletion

### addInserted

public void addInserted(SAMRecord read, int firstPosition)
Accumulate info for one read with an insertion. For this locus, the reads in the insertion are included also in recordAndOffsets

### getDeletedInRecord

public List<SamLocusIterator.RecordAndOffset> getDeletedInRecord()

### getInsertedInRecord

public List<SamLocusIterator.RecordAndOffset> getInsertedInRecord()

### size

public int size()

Overrides:
  `size` in class `AbstractLocusInfo<SamLocusIterator.RecordAndOffset>`
Returns:
  the number of records overlapping the position, with deletions included if they are being tracked.

### isEmpty

public boolean isEmpty()

Overrides:
  `isEmpty` in class `AbstractLocusInfo<SamLocusIterator.RecordAndOffset>`
Returns:
  `true` if all the RecordAndOffset lists are empty; `false` if at least one have records