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

Method next

basex-core/src/main/java/org/basex/query/func/ft/FtMark.java:53–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51 Iter nodes;
52
53 @Override
54 public Item next() throws QueryException {
55 while(true) {
56 if(iter != null) {
57 final Item item = iter.next();
58 if(item != null) return item;
59 iter = null;
60 }
61 final FTPosData tmp = qc.ftPosData;
62 try {
63 qc.ftPosData = ftd;
64 if(nodes == null) nodes = arg(0).unwrappedIter(qc);
65 final Item item = nodes.next();
66 if(item == null) return null;
67
68 // copy node to main memory data instance
69 final MemData md = new MemData(qc.context.options);
70 final DataBuilder db = new DataBuilder(md, qc);
71 db.ftpos(m, qc.ftPosData, l).build(toDBNode(item, true));
72
73 final IntList il = new IntList();
74 final int s = md.meta.size;
75 for(int p = 0; p < s; p += md.size(p, md.kind(p))) il.add(p);
76 iter = DBNodeSeq.get(il.finish(), md, FtMark.this).iter();
77 } finally {
78 qc.ftPosData = tmp;
79 }
80 }
81 }
82 };
83 }
84}

Callers

nothing calls this directly

Calls 12

ftposMethod · 0.95
addMethod · 0.95
getMethod · 0.95
finishMethod · 0.95
toDBNodeMethod · 0.80
nextMethod · 0.65
sizeMethod · 0.65
kindMethod · 0.65
iterMethod · 0.65
unwrappedIterMethod · 0.45
argMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected