/** * Return the union of this simplified interval list and the intervals of another. * * @param that A simplified list of intervals * * @return A new simplified list containing all subintervals of both this and that. */ public SimplifiedIntervalList union(SimplifiedIntervalList that) { return simplifyIntervals(this, that); }
/** * Simplify then build a list. * * @param intervals A collection of intervals */ public SimplifiedIntervalList(Collection<Interval> intervals) { super(simplifyIntervals(intervals)); }
/** * Retrieve all available intervals for all data source fields across all the underlying datasources. * <p> * Available intervals for the same underlying names are unioned into a <tt>SimplifiedIntervalList</tt> * * @return a map of metadata field names to all of its available intervals in union */ @Override public Map<String, SimplifiedIntervalList> getAllAvailableIntervals() { return getAllSourceAvailabilities() .map(Availability::getAllAvailableIntervals) .map(Map::entrySet) .flatMap(Set::stream) .collect( Collectors.toMap( Map.Entry::getKey, Map.Entry::getValue, (value1, value2) -> SimplifiedIntervalList.simplifyIntervals(value1, value2) ) ); }