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

Method test

basex-core/src/main/java/org/basex/query/expr/CmpSR.java:99–114  ·  view source on GitHub ↗
(final QueryContext qc, final InputInfo ii, final long pos)

Source from the content-addressed store, hash-verified

97 }
98
99 @Override
100 public boolean test(final QueryContext qc, final InputInfo ii, final long pos)
101 throws QueryException {
102 // atomic evaluation of arguments (faster)
103 if(single) {
104 final Item item = expr.item(qc, info);
105 return item != Empty.VALUE && eval(item);
106 }
107
108 // iterative evaluation
109 final Iter iter = expr.atomIter(qc, info);
110 for(Item item; (item = qc.next(iter)) != null;) {
111 if(eval(item)) return true;
112 }
113 return false;
114 }
115
116 /**
117 * Evaluates the range for the specified item.

Callers 1

itemMethod · 0.95

Calls 4

evalMethod · 0.95
nextMethod · 0.65
itemMethod · 0.45
atomIterMethod · 0.45

Tested by

no test coverage detected