Class RangeMapUtils
java.lang.Object
org.aksw.commons.util.range.RangeMapUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static <K extends Comparable<K>>
com.google.common.collect.RangeMap<K, ?> create(Collection<com.google.common.collect.Range<K>> ranges) Create a RangeMap with dummy values from a set of ranges.static <K extends Comparable<K>, V, C extends Collection<V>>
voidmerge(com.google.common.collect.RangeMap<K, C> rangeMap, com.google.common.collect.Range<K> range, Collection<V> values, Supplier<C> newCollection) Merge a given collection of values into the specified range.static <K extends Comparable<K>, V, C extends Collection<V>>
voidmerge(com.google.common.collect.RangeMap<K, C> rangeMap, com.google.common.collect.Range<K> range, V value, Supplier<C> newCollection) static <K extends Comparable<K>, V>
voidstatic <K extends Comparable<K>, V>
voidsplit(com.google.common.collect.RangeMap<K, V> ranges, K splitPoint)
-
Constructor Details
-
RangeMapUtils
public RangeMapUtils()
-
-
Method Details
-
merge
public static <K extends Comparable<K>, V, C extends Collection<V>> void merge(com.google.common.collect.RangeMap<K, C> rangeMap, com.google.common.collect.Range<K> range, V value, Supplier<C> newCollection) -
merge
public static <K extends Comparable<K>, V, C extends Collection<V>> void merge(com.google.common.collect.RangeMap<K, C> rangeMap, com.google.common.collect.Range<K> range, Collection<V> values, Supplier<C> newCollection) Merge a given collection of values into the specified range. All existing entries are remapped to fresh collections with these values appended, whereas all "gaps" are mapped to the same fresh copy of the given values. -
create
protected static <K extends Comparable<K>> com.google.common.collect.RangeMap<K,?> create(Collection<com.google.common.collect.Range<K>> ranges) Create a RangeMap with dummy values from a set of ranges.- Type Parameters:
K-- Parameters:
ranges-- Returns:
-
split
public static <K extends Comparable<K>, V> void split(com.google.common.collect.RangeMap<K, V> ranges, Iterable<K> splitPoints) -
split
public static <K extends Comparable<K>, V> void split(com.google.common.collect.RangeMap<K, V> ranges, K splitPoint)
-