|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object htsjdk.samtools.util.IntervalTree<V>
public class IntervalTree<V>
A Red-Black tree with intervals for keys. Not thread-safe, and cannot be made so. 7/24/2008: This was copied from the tedUtils package. IMPORTANT!!! It has been modified to use the Reseq way of handling coordinates (end-inclusive).
Nested Class Summary | |
---|---|
class |
IntervalTree.FwdIterator
|
static class |
IntervalTree.Node<V1>
|
class |
IntervalTree.OverlapIterator
|
class |
IntervalTree.RevIterator
|
static class |
IntervalTree.ValuesIterator<V1>
|
Constructor Summary | |
---|---|
IntervalTree()
|
Method Summary | |
---|---|
void |
checkMaxEnds()
This method is only for debugging. |
void |
clear()
Remove all entries. |
IntervalTree.Node<V> |
find(int start,
int end)
Find an interval. |
IntervalTree.Node<V> |
findByIndex(int idx)
Find the nth interval in the tree. |
int |
getIndex(int start,
int end)
Find the rank of the specified interval. |
V |
getSentinel()
Get the special sentinel value that will be used to signal novelty when putting a new interval into the tree, or to signal "not found" when removing an interval. |
java.util.Iterator<IntervalTree.Node<V>> |
iterator()
Return an iterator over the entire tree. |
java.util.Iterator<IntervalTree.Node<V>> |
iterator(int start,
int end)
Return an iterator over all intervals greater than or equal to the specified interval. |
IntervalTree.Node<V> |
max()
Find the greatest interval in the tree. |
IntervalTree.Node<V> |
max(int start,
int end)
Find the latest interval in the tree less than or equal to the specified interval. |
IntervalTree.Node<V> |
min()
Find the least interval in the tree. |
IntervalTree.Node<V> |
min(int start,
int end)
Find the earliest interval in the tree greater than or equal to the specified interval. |
IntervalTree.Node<V> |
minOverlapper(int start,
int end)
Find the earliest interval in the tree that overlaps the specified interval. |
java.util.Iterator<IntervalTree.Node<V>> |
overlappers(int start,
int end)
Return an iterator over all intervals overlapping the specified range. |
void |
printTree()
This method draws a nested picture of the tree on System.out. |
V |
put(int start,
int end,
V value)
Put a new interval into the tree (or update the value associated with an existing interval). |
V |
remove(int start,
int end)
Remove an interval from the tree. |
java.util.Iterator<IntervalTree.Node<V>> |
reverseIterator()
Return an iterator over the entire tree that returns intervals in reverse order. |
java.util.Iterator<IntervalTree.Node<V>> |
reverseIterator(int start,
int end)
Return an iterator over all intervals less than or equal to the specified interval, in reverse order. |
V |
setSentinel(V sentinel)
Set the special sentinel value that will be used to signal novelty when putting a new interval into the tree, or to signal "not found" when removing an interval. |
int |
size()
Return the number of intervals in the tree. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IntervalTree()
Method Detail |
---|
public int size()
public void clear()
public V put(int start, int end, V value)
start
- The interval's start.end
- The interval's end.value
- The associated value.
public V remove(int start, int end)
start
- The interval's start.end
- The interval's end.
public IntervalTree.Node<V> find(int start, int end)
start
- The interval's start.end
- The interval's end.
public IntervalTree.Node<V> findByIndex(int idx)
idx
- The rank of the interval sought (from 0 to size()-1).
public int getIndex(int start, int end)
start
- The interval's start.end
- The interval's end.
public IntervalTree.Node<V> min()
public IntervalTree.Node<V> min(int start, int end)
start
- The interval's start.end
- The interval's end.
public IntervalTree.Node<V> minOverlapper(int start, int end)
start
- The interval's start.end
- The interval's end.
public IntervalTree.Node<V> max()
public IntervalTree.Node<V> max(int start, int end)
start
- The interval's start.end
- The interval's end.
public java.util.Iterator<IntervalTree.Node<V>> iterator()
iterator
in interface java.lang.Iterable<IntervalTree.Node<V>>
public java.util.Iterator<IntervalTree.Node<V>> iterator(int start, int end)
start
- The interval's start.end
- The interval's end.
public java.util.Iterator<IntervalTree.Node<V>> overlappers(int start, int end)
start
- The range start.end
- The range end.
public java.util.Iterator<IntervalTree.Node<V>> reverseIterator()
public java.util.Iterator<IntervalTree.Node<V>> reverseIterator(int start, int end)
start
- The interval's start.end
- The interval's end.
public V getSentinel()
public V setSentinel(V sentinel)
sentinel
- The new sentinel value.
public void checkMaxEnds()
java.lang.IllegalStateException
- If an inconsistency is detected.public void printTree()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |