Package htsjdk.tribble.index.interval

# Class IntervalTreeIndex

java.lang.Object
htsjdk.tribble.index.AbstractIndex
htsjdk.tribble.index.interval.IntervalTreeIndex

All Implemented Interfaces:
  `Index`, `MutableIndex`

public class IntervalTreeIndex extends AbstractIndex
Index based on an interval tree

See Also:
  - `IntervalTree`

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`IntervalTreeIndex.ChrIndex`

## Nested classes/interfaces inherited from class htsjdk.tribble.index.AbstractIndex

`AbstractIndex.BlockStats, AbstractIndex.IndexType`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`INDEX_TYPE`

### Fields inherited from class htsjdk.tribble.index.AbstractIndex

`chrIndices, flags, indexedFileMD5, indexedFileSize, indexedFileTS, indexedPath, logger, MAGIC_NUMBER, version, VERSION`

## Constructor Summary

Constructors
Constructor
Description
`IntervalTreeIndex(InputStream inputStream)`
Load from file.
`IntervalTreeIndex(String featureFile)`
Prepare to build an index.
`IntervalTreeIndex(Path featureFile)`
Prepare to build an index.

## Method Summary

Modifier and Type
Method
Description
`Class`
`getChrIndexClass()`
returns the class for the index type
`protected int`
`getType()`
get the index type
`void`
`insert(String chr, Interval interval)`
Add a new interval to this index
`void`
`printTree()`
`protected void`
`setChrIndex(List<IntervalTreeIndex.ChrIndex> indicies)`

### Methods inherited from class htsjdk.tribble.index.AbstractIndex

`addProperties, addProperty, containsChromosome, equalsIgnoreProperties, finalizeIndex, getBlocks, getBlocks, getBlockStats, getFlags, getIndexedFile, getIndexedFileMD5, getIndexedFileSize, getIndexedFileTS, getIndexedPath, getProperties, getSequenceNames, getVersion, hasFileSize, hasMD5, hasTimestamp, isCurrentVersion, printIndexInfo, read, setMD5, statsSummary, validateIndexHeader, write, write, writeBasedOnFeaturePath`

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

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

### Methods inherited from interface htsjdk.tribble.index.Index

`write, writeBasedOnFeatureFile`

## Field Details

### INDEX_TYPE

public static final int INDEX_TYPE

## Constructor Details

### IntervalTreeIndex

public IntervalTreeIndex(InputStream inputStream) throws IOException
Load from file.

Parameters:
  `inputStream` - This method assumes that the input stream is already buffered as appropriate. Caller should close after this object is constructed.
Throws:
  `IOException`

### IntervalTreeIndex

public IntervalTreeIndex(Path featureFile)
Prepare to build an index.

Parameters:
  `featureFile` - File which we are indexing

### IntervalTreeIndex

public IntervalTreeIndex(String featureFile)
Prepare to build an index.

Parameters:
  `featureFile` - File which we are indexing

## Method Details

### getChrIndexClass

public Class getChrIndexClass()
Description copied from class: `AbstractIndex`
returns the class for the index type

Specified by:
  `getChrIndexClass` in class `AbstractIndex`
Returns:
  a Class, from which a new instance can be created

### getType

protected int getType()
Description copied from class: `AbstractIndex`
get the index type

Specified by:
  `getType` in class `AbstractIndex`
Returns:
  The index type

### insert

public void insert(String chr, Interval interval)
Add a new interval to this index

Parameters:
  `chr` - Chromosome
  `interval` -

### setChrIndex

protected void setChrIndex(List<IntervalTreeIndex.ChrIndex> indicies)

### printTree

public void printTree()