Interface RangeTree<C extends Comparable>

Type Parameters:
C - range endpoint type
All Known Implementing Classes:
AbstractRangeTree, CenteredRangeTree, RangeList

public interface RangeTree<C extends Comparable>
Range tree.
Author:
Michael Heuer
  • 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<com.google.common.collect.Range<C>>
    intersect(com.google.common.collect.Range<C> query)
    Return the ranges in this range tree that intersect the specified query range, if any.
    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.
    int
    Return the number of ranges in this range tree.
  • Method Details

    • size

      int size()
      Return the number of ranges in this range tree.
      Returns:
      the number of ranges in this range tree
    • isEmpty

      boolean isEmpty()
      Return true if the number of ranges in this range tree is zero.
      Returns:
      true if the number of ranges in this range tree is zero
    • contains

      boolean contains(C location)
      Return true if the specified location intersects with any ranges in this range tree.
      Parameters:
      location - location to intersect
      Returns:
      true if the specified location intersects with any ranges in this range tree
    • count

      int count(C location)
      Return the number of ranges in this range tree at the specified location.
      Parameters:
      location - location
      Returns:
      the number of ranges in this range tree at the specified location
    • query

      Iterable<com.google.common.collect.Range<C>> query(C location)
      Return the ranges in this range tree at the specified location, if any.
      Parameters:
      location - location
      Returns:
      the ranges in this range tree at the specified location, if any
    • count

      int count(com.google.common.collect.Range<C> query)
      Return the number of ranges in this range tree that intersect the specified query range.
      Parameters:
      query - range to intersect, must not be null
      Returns:
      the number of ranges in this range tree that intersect the specified query range
    • intersect

      Iterable<com.google.common.collect.Range<C>> intersect(com.google.common.collect.Range<C> query)
      Return 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
    • intersects

      boolean intersects(com.google.common.collect.Range<C> query)
      Return true if the specified query range intersects with any ranges in this range tree.
      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

      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.
      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

      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.
      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