# Class IntervalList.IntervalMergerIterator

java.lang.Object
htsjdk.samtools.util.IntervalList.IntervalMergerIterator

All Implemented Interfaces:
  `Iterator<Interval>`

Enclosing class:
  `IntervalList`

public static class IntervalList.IntervalMergerIterator extends Object implements Iterator<Interval>
An iterator that feeds on an `Iterator<Interval>` and combines consecutive intervals that need merging. Overlapping intervals will always be merged, abutting intervals are optionally merged. The iterator assumes that the intervals are sorted. Results are undefined if they are not sorted.

## Constructor Summary

Constructors
Constructor
Description
`IntervalMergerIterator(Iterator<Interval> intervals, boolean combineAbuttingIntervals, boolean enforceSameStrand, boolean concatenateNames)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`hasNext()`
`Interval`
`next()`

### Methods inherited from class Object

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

### Methods inherited from interface Iterator

`forEachRemaining, remove`

## Constructor Details

### IntervalMergerIterator

public IntervalMergerIterator(Iterator<Interval> intervals, boolean combineAbuttingIntervals, boolean enforceSameStrand, boolean concatenateNames)

## Method Details

### hasNext

public boolean hasNext()

Specified by:
  `hasNext` in interface `Iterator<Interval>`

### next

public Interval next()

Specified by:
  `next` in interface `Iterator<Interval>`