com.bbn.bue.common.collections.OverlappingRangeSet Maven / Gradle / Ivy
The newest version!
package com.bbn.bue.common.collections;
import com.google.common.collect.Range;
import java.util.Collection;
/**
* A container for a set of potentially overlapping {@code Range} which supports various
* containment queries. All operations support the closedness notion of the inserted {@link
* Range}s.
*
* Guava supports collections disjoint and nested ranges, see {@link
* com.google.common.collect.RangeSet} and {@link com.google.common.collect.TreeRangeSet}, however
* there is no current implementation for a structured set of {@link Range}s which may overlap. This
* class aims to fill that gap.
*
* @author Jay DeYoung
*/
public interface OverlappingRangeSet> {
/**
* Returns a {@link Collection} of ranges containing this item. Multiplicity preservation is
* implementation dependent.
*/
Collection> rangesContaining(T item);
/**
* Returns a {@link Collection} of ranges containing this query range. Multiplicity preservation
* is implementation dependent.
*/
Collection> rangesContaining(Range queryRange);
/**
* Returns a {@link Collection} of ranges contained by this query range. Multiplicity preservation
* is implementation dependent.
*/
Collection> rangesContainedBy(Range queryRange);
/**
* Returns a {@link Collection} of ranges overlapping this query range. Multiplicity preservation
* is implementation dependent.
*/
Collection> rangesOverlapping(Range queryRange);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy