# Class IntervalTreeMap<T>

java.lang.Object
java.util.AbstractMap<Interval,T>
htsjdk.samtools.util.IntervalTreeMap<T>

All Implemented Interfaces:
  `Map<Interval,T>`

public class IntervalTreeMap<T> extends AbstractMap<Interval,T>
Utility class that implements an interval map. This class functions as a java map but also supports efficient interval overlap queries.

## Nested Class Summary

### Nested classes/interfaces inherited from class AbstractMap

`AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>`

### Nested classes/interfaces inherited from interface Map

`Map.Entry<K,V>`

## Constructor Summary

Constructors
Constructor
Description
`IntervalTreeMap()`
`IntervalTreeMap(Map<? extends Interval, ? extends T> map)`

## Method Summary

Modifier and Type
Method
Description
`void`
`clear()`
`boolean`
`containsContained(Locatable key)`
Test if this contains an object that is contained by 'key'
`boolean`
`containsKey(Interval key)`
`boolean`
`containsKey(Object object)`
`boolean`
`containsOverlapping(Locatable key)`
Test overlapping interval
`IntervalTree<T>`
`debugGetTree(String sequence)`
`Set<Map.Entry<Interval,T>>`
`entrySet()`
`boolean`
`equals(Object o)`
`T`
`get(Interval key)`
`T`
`get(Object object)`
`Collection<T>`
`getContained(Locatable key)`
`Collection<T>`
`getOverlapping(Locatable key)`
`int`
`hashCode()`
`boolean`
`isEmpty()`
`T`
`put(Interval key, T value)`
`T`
`remove(Interval key)`
`T`
`remove(Object object)`
`int`
`size()`

### Methods inherited from class AbstractMap

`clone, containsValue, keySet, putAll, toString, values`

### Methods inherited from class Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface Map

`compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll`

## Constructor Details

### IntervalTreeMap

public IntervalTreeMap()

### IntervalTreeMap

public IntervalTreeMap(Map<? extends Interval, ? extends T> map)

## Method Details

### debugGetTree

public IntervalTree<T> debugGetTree(String sequence)

### clear

public void clear()

Specified by:
  `clear` in interface `Map<Interval,T>`
Overrides:
  `clear` in class `AbstractMap<Interval,T>`

### containsKey

public boolean containsKey(Object object)

Specified by:
  `containsKey` in interface `Map<Interval,T>`
Overrides:
  `containsKey` in class `AbstractMap<Interval,T>`

### containsKey

public boolean containsKey(Interval key)

### entrySet

public Set<Map.Entry<Interval,T>> entrySet()

Specified by:
  `entrySet` in interface `Map<Interval,T>`
Specified by:
  `entrySet` in class `AbstractMap<Interval,T>`

### equals

public boolean equals(Object o)

Specified by:
  `equals` in interface `Map<Interval,T>`
Overrides:
  `equals` in class `AbstractMap<Interval,T>`

### hashCode

public int hashCode()

Specified by:
  `hashCode` in interface `Map<Interval,T>`
Overrides:
  `hashCode` in class `AbstractMap<Interval,T>`

### get

public T get(Object object)

Specified by:
  `get` in interface `Map<Interval,T>`
Overrides:
  `get` in class `AbstractMap<Interval,T>`

### get

public T get(Interval key)

### isEmpty

public boolean isEmpty()

Specified by:
  `isEmpty` in interface `Map<Interval,T>`
Overrides:
  `isEmpty` in class `AbstractMap<Interval,T>`

### put

public T put(Interval key, T value)

Specified by:
  `put` in interface `Map<Interval,T>`
Overrides:
  `put` in class `AbstractMap<Interval,T>`

### remove

public T remove(Object object)

Specified by:
  `remove` in interface `Map<Interval,T>`
Overrides:
  `remove` in class `AbstractMap<Interval,T>`

### remove

public T remove(Interval key)

### size

public int size()

Specified by:
  `size` in interface `Map<Interval,T>`
Overrides:
  `size` in class `AbstractMap<Interval,T>`

### containsOverlapping

public boolean containsOverlapping(Locatable key)
Test overlapping interval

Parameters:
  `key` - the Locatable
Returns:
  true if it contains an object overlapping the interval

### getOverlapping

public Collection<T> getOverlapping(Locatable key)

### containsContained

public boolean containsContained(Locatable key)
Test if this contains an object that is contained by 'key'

Parameters:
  `key` - the Locatable
Returns:
  true if it contains an object is contained by 'key'

### getContained

public Collection<T> getContained(Locatable key)