| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
package org.apache.lucene.search; |
| 18 |
|
|
| 19 |
|
import java.util.Iterator; |
| 20 |
|
import java.util.NoSuchElementException; |
| 21 |
|
|
| 22 |
|
|
| 23 |
|
@link |
| 24 |
|
@link@link |
| 25 |
|
@link |
| 26 |
|
|
| 27 |
|
@author |
| 28 |
|
|
|
|
|
| 87.5% |
Uncovered Elements: 2 (16) |
Complexity: 6 |
Complexity Density: 0.67 |
|
| 29 |
|
public class HitIterator implements Iterator { |
| 30 |
|
private Hits hits; |
| 31 |
|
private int hitNumber = 0; |
| 32 |
|
|
| 33 |
|
|
| 34 |
|
@link |
| 35 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 36 |
1
|
HitIterator(Hits hits) {... |
| 37 |
1
|
this.hits = hits; |
| 38 |
|
} |
| 39 |
|
|
| 40 |
|
|
| 41 |
|
@return@link |
| 42 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 43 |
3
|
public boolean hasNext() {... |
| 44 |
3
|
return hitNumber < hits.length(); |
| 45 |
|
} |
| 46 |
|
|
| 47 |
|
|
| 48 |
|
@link@link |
| 49 |
|
|
| 50 |
|
@return@link |
| 51 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
| 52 |
3
|
public Object next() {... |
| 53 |
3
|
if (hitNumber == hits.length()) |
| 54 |
1
|
throw new NoSuchElementException(); |
| 55 |
|
|
| 56 |
2
|
Object next = new Hit(hits, hitNumber); |
| 57 |
2
|
hitNumber++; |
| 58 |
2
|
return next; |
| 59 |
|
} |
| 60 |
|
|
| 61 |
|
|
| 62 |
|
|
| 63 |
|
|
| 64 |
|
@throws |
| 65 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 66 |
0
|
public void remove() {... |
| 67 |
0
|
throw new UnsupportedOperationException(); |
| 68 |
|
} |
| 69 |
|
|
| 70 |
|
|
| 71 |
|
|
| 72 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 73 |
1
|
public int length() {... |
| 74 |
1
|
return hits.length(); |
| 75 |
|
} |
| 76 |
|
} |
| 77 |
|
|