MCPcopy Create free account
hub / github.com/BaseXdb/basex / iter

Method iter

basex-core/src/main/java/org/basex/index/value/MemValues.java:49–73  ·  view source on GitHub ↗
(final IndexSearch search)

Source from the content-addressed store, hash-verified

47 }
48
49 @Override
50 public IndexIterator iter(final IndexSearch search) {
51 final int id = values.index(search.token());
52 if(id == 0) return IndexIterator.EMPTY;
53
54 final int len = lenList.get(id);
55 final int[] ids = idsList.get(id), pres;
56 if(data.meta.updindex) {
57 final IntList tmp = new IntList();
58 for(int i = 0; i < len; ++i) tmp.add(data.pre(ids[i]));
59 pres = tmp.sort().finish();
60 } else {
61 pres = ids;
62 }
63
64 return new IndexIterator() {
65 int p;
66 @Override
67 public boolean more() { return p < len; }
68 @Override
69 public int pre() { return pres[p++]; }
70 @Override
71 public int size() { return len; }
72 };
73 }
74
75 @Override
76 public IndexCosts costs(final IndexSearch search) {

Callers

nothing calls this directly

Calls 7

addMethod · 0.95
sortMethod · 0.95
indexMethod · 0.65
tokenMethod · 0.65
getMethod · 0.65
preMethod · 0.65
finishMethod · 0.45

Tested by

no test coverage detected