private void setupParent(UnitNRShape unitShape) { parentShape = unitShape.clone(); //Look for existing parentFacet (from previous segment), or create anew if needed parentFacet = facets.parents.get(parentShape); if (parentFacet == null) {//didn't find one; make a new one parentFacet = new Facets.FacetParentVal(); parentFacet.childCountsLen = getGrid().getNumSubCells(parentShape); facets.parents.put(parentShape, parentFacet); } } });
/** Calculates facets between {@code start} and {@code end} to a detail level one greater than that provided by the * arguments. For example providing March to October of 2014 would return facets to the day level of those months. * This is just a convenience method. * @see #calcFacets(IndexReaderContext, Bits, Shape, int) */ public Facets calcFacets(IndexReaderContext context, Bits topAcceptDocs, UnitNRShape start, UnitNRShape end) throws IOException { Shape facetRange = getGrid().toRangeShape(start, end); int detailLevel = Math.max(start.getLevel(), end.getLevel()) + 1; return calcFacets(context, topAcceptDocs, facetRange, detailLevel); }