(int k, int numHash, BloomFilterDeBruijnGraph graph, int depth)
| 445 | } |
| 446 | |
| 447 | public boolean hasDepthLeft(int k, int numHash, BloomFilterDeBruijnGraph graph, int depth) { |
| 448 | ArrayDeque<PredecessorsNTHashIterator> stack = new ArrayDeque<>(depth); |
| 449 | PredecessorsNTHashIterator itr = new PredecessorsNTHashIterator(k, numHash); |
| 450 | |
| 451 | itr.start(fHashVal, bytes[k-1]); |
| 452 | stack.add(itr); |
| 453 | |
| 454 | byte[] extension = new byte[depth]; |
| 455 | int extensionLength = 1; |
| 456 | while (extensionLength > 0) { |
| 457 | if (extensionLength >= depth) { |
| 458 | return true; |
| 459 | } |
| 460 | |
| 461 | itr = stack.getLast(); |
| 462 | |
| 463 | if (itr.hasNext()) { |
| 464 | itr.next(); |
| 465 | extension[extensionLength-1] = itr.currentChar(); |
| 466 | |
| 467 | PredecessorsNTHashIterator nextItr = new PredecessorsNTHashIterator(k, numHash); |
| 468 | |
| 469 | if (extensionLength < k) { |
| 470 | nextItr.start(itr.hVals[0], bytes[k-1-extensionLength]); |
| 471 | } |
| 472 | else { |
| 473 | nextItr.start(itr.hVals[0], extension[extensionLength-k]); |
| 474 | } |
| 475 | |
| 476 | stack.addLast(nextItr); |
| 477 | ++extensionLength; |
| 478 | } |
| 479 | else { |
| 480 | stack.pollLast(); |
| 481 | --extensionLength; |
| 482 | } |
| 483 | } |
| 484 | |
| 485 | return false; |
| 486 | } |
| 487 | } |
no test coverage detected