Class AbstractRangeTree<C extends Comparable>

java.lang.Object
org.dishevelled.bio.range.tree.AbstractRangeTree<C>
Type Parameters:
C - range endpoint type
All Implemented Interfaces:
RangeTree<C>
Direct Known Subclasses:
CenteredRangeTree, RangeList

public abstract class AbstractRangeTree<C extends Comparable> extends Object implements RangeTree<C>
Abstract implementation of range tree. Most methods will need to be overridden to improve performance.
Author:
Michael Heuer
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(C location)
    Return true if the specified location intersects with any ranges in this range tree.
    int
    count(C location)
    Return the number of ranges in this range tree at the specified location.
    int
    count(com.google.common.collect.Range<C> query)
    Return the number of ranges in this range tree that intersect the specified query range.
    Iterable<Set<com.google.common.collect.Range<C>>>
    intersect(Iterable<com.google.common.collect.Range<C>> query)
    Return the intersection of the ranges in this range tree with the specified query list of ranges as intersecting pairs of ranges, if any.
    boolean
    intersects(com.google.common.collect.Range<C> query)
    Return true if the specified query range intersects with any ranges in this range tree.
    boolean
    intersects(Iterable<com.google.common.collect.Range<C>> query)
    Return true if any range in the specified query list of ranges intersects with any ranges in this range tree.
    boolean
    Return true if the number of ranges in this range tree is zero.
    Iterable<com.google.common.collect.Range<C>>
    query(C location)
    Return the ranges in this range tree at the specified location, if any.

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.dishevelled.bio.range.tree.RangeTree

    intersect, size
  • Constructor Details

    • AbstractRangeTree

      public AbstractRangeTree()
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Description copied from interface: RangeTree
      Return true if the number of ranges in this range tree is zero.
      Specified by:
      isEmpty in interface RangeTree<C extends Comparable>
      Returns:
      true if the number of ranges in this range tree is zero
    • contains

      public boolean contains(C location)
      Description copied from interface: RangeTree
      Return true if the specified location intersects with any ranges in this range tree.
      Specified by:
      contains in interface RangeTree<C extends Comparable>
      Parameters:
      location - location to intersect
      Returns:
      true if the specified location intersects with any ranges in this range tree
    • count

      public int count(C location)
      Description copied from interface: RangeTree
      Return the number of ranges in this range tree at the specified location.
      Specified by:
      count in interface RangeTree<C extends Comparable>
      Parameters:
      location - location
      Returns:
      the number of ranges in this range tree at the specified location
    • query

      public Iterable<com.google.common.collect.Range<C>> query(C location)
      Description copied from interface: RangeTree
      Return the ranges in this range tree at the specified location, if any.
      Specified by:
      query in interface RangeTree<C extends Comparable>
      Parameters:
      location - location
      Returns:
      the ranges in this range tree at the specified location, if any
    • count

      public int count(com.google.common.collect.Range<C> query)
      Description copied from interface: RangeTree
      Return the number of ranges in this range tree that intersect the specified query range.
      Specified by:
      count in interface RangeTree<C extends Comparable>
      Parameters:
      query - range to intersect, must not be null
      Returns:
      the number of ranges in this range tree that intersect the specified query range
    • intersects

      public boolean intersects(com.google.common.collect.Range<C> query)
      Description copied from interface: RangeTree
      Return true if the specified query range intersects with any ranges in this range tree.
      Specified by:
      intersects in interface RangeTree<C extends Comparable>
      Parameters:
      query - range to intersect, must not be null
      Returns:
      true if the specified query range intersects with any ranges in this range tree
    • intersect

      public Iterable<Set<com.google.common.collect.Range<C>>> intersect(Iterable<com.google.common.collect.Range<C>> query)
      Description copied from interface: RangeTree
      Return the intersection of the ranges in this range tree with the specified query list of ranges as intersecting pairs of ranges, if any.
      Specified by:
      intersect in interface RangeTree<C extends Comparable>
      Parameters:
      query - list of ranges to intersect, must not be null
      Returns:
      the intersection of the ranges in this range tree with the specified query list of ranges as intersecting pairs of ranges, if any
    • intersects

      public boolean intersects(Iterable<com.google.common.collect.Range<C>> query)
      Description copied from interface: RangeTree
      Return true if any range in the specified query list of ranges intersects with any ranges in this range tree.
      Specified by:
      intersects in interface RangeTree<C extends Comparable>
      Parameters:
      query - list of ranges to intersect, must not be null
      Returns:
      true if any range in the specified query list of ranges intersects with any ranges in this range tree