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

Method next

basex-core/src/main/java/org/basex/query/expr/Union.java:90–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

88 NodeIter iterate(final QueryContext qc) throws QueryException {
89 return new SetIter(qc, iters(qc)) {
90 @Override
91 public GNode next() throws QueryException {
92 if(nodes == null) {
93 final int il = iter.length;
94 nodes = new GNode[il];
95 for(int i = 0; i < il; i++) next(i);
96 }
97
98 int m = -1;
99 final int il = nodes.length;
100 for(int i = 0; i < il; i++) {
101 if(nodes[i] == null) continue;
102 final int d = m == -1 ? 1 : nodes[m].compare(nodes[i]);
103 if(d == 0) {
104 next(i--);
105 } else if(d > 0) {
106 m = i;
107 }
108 }
109 if(m == -1) return null;
110
111 final GNode node = nodes[m];
112 next(m);
113 return node;
114 }
115 };
116 }
117

Callers

nothing calls this directly

Calls 1

compareMethod · 0.45

Tested by

no test coverage detected