Lines Matching refs:candidate

108     private Candidate candidate;  field in S2RegionCoverer.QueueEntry
110 public QueueEntry(int id, Candidate candidate) { in QueueEntry() argument
112 this.candidate = candidate; in QueueEntry()
345 Candidate candidate = new Candidate(); in newCandidate() local
346 candidate.cell = cell; in newCandidate()
347 candidate.isTerminal = isTerminal; in newCandidate()
349 candidate.children = new Candidate[1 << maxChildrenShift()]; in newCandidate()
352 return candidate; in newCandidate()
365 private void addCandidate(Candidate candidate) { in addCandidate() argument
366 if (candidate == null) { in addCandidate()
370 if (candidate.isTerminal) { in addCandidate()
371 result.add(candidate.cell.id()); in addCandidate()
378 int numLevels = (candidate.cell.level() < minLevel) ? 1 : levelMod; in addCandidate()
379 int numTerminals = expandChildren(candidate, candidate.cell, numLevels); in addCandidate()
381 if (candidate.numChildren == 0) { in addCandidate()
384 && candidate.cell.level() >= minLevel) { in addCandidate()
389 candidate.isTerminal = true; in addCandidate()
390 addCandidate(candidate); in addCandidate()
399 int priority = -((((candidate.cell.level() << maxChildrenShift()) + candidate.numChildren) in addCandidate()
401 candidateQueue.add(new QueueEntry(priority, candidate)); in addCandidate()
411 private int expandChildren(Candidate candidate, S2Cell cell, int numLevels) { in expandChildren() argument
422 numTerminals += expandChildren(candidate, childCells[i], numLevels); in expandChildren()
428 candidate.children[candidate.numChildren++] = child; in expandChildren()
496 Candidate candidate = candidateQueue.poll().candidate; in getCoveringInternal() local
498 if (candidate.cell.level() < minLevel || candidate.numChildren == 1 in getCoveringInternal()
499 || result.size() + (interiorCovering ? 0 : candidateQueue.size()) + candidate.numChildren in getCoveringInternal()
502 for (int i = 0; i < candidate.numChildren; ++i) { in getCoveringInternal()
503 addCandidate(candidate.children[i]); in getCoveringInternal()
508 candidate.isTerminal = true; in getCoveringInternal()
509 addCandidate(candidate); in getCoveringInternal()