public final class IntervalArray<T> extends Object implements Serializable
Interval
objects representing an immutable interval
tree.
The query results are sorted lexicographically by (begin, end)
.Modifier and Type | Class and Description |
---|---|
class |
IntervalArray.QueryResult
Type for storing the query result.
|
Constructor and Description |
---|
IntervalArray(Collection<T> elements,
IntervalEndExtractor<T> extractor)
Construct object with the given values.
|
Modifier and Type | Method and Description |
---|---|
IntervalArray.QueryResult |
findOverlappingWithInterval(int begin,
int end)
Query the encoded interval tree for all values with intervals overlapping
with a given
interval . |
IntervalArray.QueryResult |
findOverlappingWithPoint(int point)
Query the encoded interval tree for all values with intervals overlapping
with a given
point . |
com.google.common.collect.ImmutableList<Interval<T>> |
getIntervals() |
com.google.common.collect.ImmutableList<Interval<T>> |
getIntervalsEnd() |
int |
size() |
public IntervalArray(Collection<T> elements, IntervalEndExtractor<T> extractor)
public com.google.common.collect.ImmutableList<Interval<T>> getIntervals()
Interval
s, sorted by begin positionpublic com.google.common.collect.ImmutableList<Interval<T>> getIntervalsEnd()
Interval
s, sorted by end positionpublic int size()
public IntervalArray.QueryResult findOverlappingWithPoint(int point)
point
.point
- zero-based point for the querypoint
public IntervalArray.QueryResult findOverlappingWithInterval(int begin, int end)
interval
.begin
- zero-based begin position of the query intervalend
- zero-based end position of the query interval[begin, end)
Copyright © 2016. All rights reserved.