org.utgenome.gwt.utgb.client.canvas
Class IntervalTree<T extends GenomeRange>

java.lang.Object
  extended by java.util.AbstractCollection<T>
      extended by org.utgenome.gwt.utgb.client.canvas.IntervalTree<T>
All Implemented Interfaces:
Iterable<T>, Collection<T>

public class IntervalTree<T extends GenomeRange>
extends AbstractCollection<T>

Interval layout

Author:
leo

Constructor Summary
IntervalTree()
           
 
Method Summary
 boolean add(T elem)
          Add an entry [start, end)
 void clear()
           
 int countOverlap(int start)
           
 int countOverlap(int start, int end)
           
 List<T> elementList()
          return the elements in the tree
 T findOverlap(GenomeRange target)
           
 boolean isEmpty()
           
 Iterator<T> iterator()
           
 List<T> overlapQuery(GenomeRange target)
           
 void overlapQuery(GenomeRange target, PrioritySearchTree.ResultHandler<T> handler)
           
 List<T> overlapQuery(int start)
           
 List<T> overlapQuery(int start, int end)
          Get entries overlapping with [start, end)
 void overlapQuery(int start, int end, PrioritySearchTree.ResultHandler<T> handler)
          Get entries overlapping with [start, end)
 void overlapQuery(int start, PrioritySearchTree.ResultHandler<T> handler)
           
 boolean remove(T t)
           
 void removeBefore(int start)
          Removes the intervals contained in [-oo, start)
 void removeBefore(int start, PrioritySearchTree.ResultHandler<T> handler)
           
 int size()
           
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

IntervalTree

public IntervalTree()
Method Detail

add

public boolean add(T elem)
Add an entry [start, end)

Specified by:
add in interface Collection<T extends GenomeRange>
Overrides:
add in class AbstractCollection<T extends GenomeRange>
Parameters:
elem -

remove

public boolean remove(T t)

overlapQuery

public void overlapQuery(int start,
                         PrioritySearchTree.ResultHandler<T> handler)

overlapQuery

public List<T> overlapQuery(int start)

countOverlap

public int countOverlap(int start)

countOverlap

public int countOverlap(int start,
                        int end)

overlapQuery

public List<T> overlapQuery(int start,
                            int end)
Get entries overlapping with [start, end)

Parameters:
start - query start (inclusive)
end - query end (exclusive)
Returns:

overlapQuery

public void overlapQuery(int start,
                         int end,
                         PrioritySearchTree.ResultHandler<T> handler)
Get entries overlapping with [start, end)

Parameters:
start - query start (inclusive)
end - query end (exclusive)
handler -

overlapQuery

public void overlapQuery(GenomeRange target,
                         PrioritySearchTree.ResultHandler<T> handler)

overlapQuery

public List<T> overlapQuery(GenomeRange target)

findOverlap

public T findOverlap(GenomeRange target)

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<T extends GenomeRange>
Overrides:
isEmpty in class AbstractCollection<T extends GenomeRange>

clear

public void clear()
Specified by:
clear in interface Collection<T extends GenomeRange>
Overrides:
clear in class AbstractCollection<T extends GenomeRange>

removeBefore

public void removeBefore(int start)
Removes the intervals contained in [-oo, start)

Parameters:
start -

removeBefore

public void removeBefore(int start,
                         PrioritySearchTree.ResultHandler<T> handler)

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T extends GenomeRange>
Specified by:
iterator in interface Collection<T extends GenomeRange>
Specified by:
iterator in class AbstractCollection<T extends GenomeRange>

elementList

public List<T> elementList()
return the elements in the tree

Returns:

size

public int size()
Specified by:
size in interface Collection<T extends GenomeRange>
Specified by:
size in class AbstractCollection<T extends GenomeRange>


Copyright © 2007-2012 utgenome.org. All Rights Reserved.