@Override public VNode next() { assert hasNext(); vNode.reset(cellIter.next()); return vNode; }
/** Called initially, and whenever {@link #visitPrefix(org.apache.lucene.spatial.prefix.tree.Cell)} * returns true. */ private void addIntersectingChildren() throws IOException { assert thisTerm != null; Cell cell = curVNode.cell; if (cell.getLevel() >= detailLevel) throw new IllegalStateException("Spatial logic error"); //Decide whether to continue to divide & conquer, or whether it's time to // scan through terms beneath this cell. // Scanning is a performance optimization trade-off. //TODO use termsEnum.docFreq() as heuristic boolean scan = cell.getLevel() >= prefixGridScanLevel;//simple heuristic if (!scan) { //Divide & conquer (ultimately termsEnum.seek()) Iterator<Cell> subCellsIter = findSubCellsToVisit(cell); if (!subCellsIter.hasNext())//not expected return; curVNode.children = new VNodeCellIterator(subCellsIter, new VNode(curVNode)); } else { //Scan (loop of termsEnum.next()) scan(detailLevel); } }
/** Called initially, and whenever {@link #visitPrefix(org.apache.lucene.spatial.prefix.tree.Cell)} * returns true. */ private void addIntersectingChildren() throws IOException { assert thisTerm != null; Cell cell = curVNode.cell; if (cell.getLevel() >= detailLevel) throw new IllegalStateException("Spatial logic error"); //Decide whether to continue to divide & conquer, or whether it's time to // scan through terms beneath this cell. // Scanning is a performance optimization trade-off. //TODO use termsEnum.docFreq() as heuristic boolean scan = cell.getLevel() >= prefixGridScanLevel;//simple heuristic if (!scan) { //Divide & conquer (ultimately termsEnum.seek()) Iterator<Cell> subCellsIter = findSubCellsToVisit(cell); if (!subCellsIter.hasNext())//not expected return; curVNode.children = new VNodeCellIterator(subCellsIter, new VNode(curVNode)); } else { //Scan (loop of termsEnum.next()) scan(detailLevel); } }
@Override public VNode next() { assert hasNext(); vNode.reset(cellIter.next()); return vNode; }