List<FrozenCell> splitRange(FrozenCell cell) { if (!cell.canBeContainedByChildren()) { return Collections.emptyList(); } Granularity childGran = cell.getLayer().getChild().getGranularity(); if (childGran.isSmallerThan(minGran)) { return Collections.emptyList(); } return cell.getChildren(); } }
public List<FrozenCell> getChildren() { if (children != null) { return children; } children = makeChildrenCells(); return children; }
removeFromProcess.add(cell); TimeRange cellRange = cell.getRange(); if (!inRange.overlaps(cellRange)) { continue; result.add(cell); } else { addToProcess.addAll(cell.getChildren());
/** * @param timeRange The {@link TimeRange} which defines the start and end time of the cell. * @return A {@link FrozenCell} within the given granularity. */ public FrozenCell getCell(TimeRange timeRange) { FrozenCell res = cells.get(timeRange); if (res != null) { return res; } Granularity gran = getGranularity(); Time rangeStart = timeRange.getStartTime(); if (rangeStart.alignsOnGranularity(gran) == false) { throw new IllegalArgumentException("Range [" + timeRange + "] does not belong to this granularity [" + gran + "]"); } if (!canFullyContain(timeRange)) { throw new IllegalArgumentException("Range [" + timeRange + "] is not currently in scope for granularity [" + gran + "] " + " which has a total range of [" + getTotalRange() + "]"); } res = new FrozenCell(this, timeRange); cells.put(timeRange, res); return res; }
/** * Returns the minimum set of time ranges which cover 'in', but do not lie outside * of 'out'. * * It is possible the list of resulting ranges does not cover the input range. This * can happen when the out/in ranges are tight. */ public List<TimeRange> expand(FuzzyTimeRange range) { List<FrozenCell> cells = getCellsOverlapping(range); List<TimeRange> res = new ArrayList<TimeRange>(cells.size()); for (FrozenCell cell : cells) { res.add(cell.getRange()); } return res; }
result.add(cell.getRange());