Package org.dishevelled.bio.range.tree
Class RangeList<C extends Comparable>
java.lang.Object
org.dishevelled.bio.range.tree.AbstractRangeTree<C>
org.dishevelled.bio.range.tree.RangeList<C>
- Type Parameters:
C- range endpoint type
- All Implemented Interfaces:
RangeTree<C>
Range list.
- Author:
- Michael Heuer
-
Method Summary
Modifier and TypeMethodDescriptionstatic <C extends Comparable>
RangeTree<C>Create and return a new range tree from the specified ranges.Return the ranges in this range tree that intersect the specified query range, if any.booleanisEmpty()Return true if the number of ranges in this range tree is zero.intsize()Return the number of ranges in this range tree.Methods inherited from class org.dishevelled.bio.range.tree.AbstractRangeTree
contains, count, count, intersect, intersects, intersects, query
-
Method Details
-
size
public int size()Description copied from interface:RangeTreeReturn the number of ranges in this range tree.- Returns:
- the number of ranges in this range tree
-
isEmpty
public boolean isEmpty()Description copied from interface:RangeTreeReturn true if the number of ranges in this range tree is zero.- Specified by:
isEmptyin interfaceRangeTree<C extends Comparable>- Overrides:
isEmptyin classAbstractRangeTree<C extends Comparable>- Returns:
- true if the number of ranges in this range tree is zero
-
intersect
public Iterable<com.google.common.collect.Range<C>> intersect(com.google.common.collect.Range<C> query) Description copied from interface:RangeTreeReturn the ranges in this range tree that intersect the specified query range, if any.- Parameters:
query- range to intersect, must not be null- Returns:
- the ranges in this range tree that intersect the specified query range, if any
-
create
public static <C extends Comparable> RangeTree<C> create(Iterable<com.google.common.collect.Range<C>> ranges) Create and return a new range tree from the specified ranges.- Type Parameters:
C- range endpoint type- Parameters:
ranges- ranges, must not be null- Returns:
- a new range tree from the specified ranges
-