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

Method item

basex-core/src/main/java/org/basex/query/func/bin/BinNot.java:16–28  ·  view source on GitHub ↗
(final QueryContext qc, final InputInfo ii)

Source from the content-addressed store, hash-verified

14 */
15public final class BinNot extends StandardFunc {
16 @Override
17 public Item item(final QueryContext qc, final InputInfo ii) throws QueryException {
18 final Bin value = toBinOrNull(arg(0), qc);
19 if(value == null) return Empty.VALUE;
20
21 final byte[] bytes = value.binary(info);
22 final int bl = bytes.length;
23 if(bl == 1) return B64.get((byte) ~bytes[0]);
24
25 final byte[] tmp = new byte[bl];
26 for(int b = 0; b < bl; b++) tmp[b] = (byte) ~bytes[b];
27 return B64.get(tmp);
28 }
29}

Callers

nothing calls this directly

Calls 4

binaryMethod · 0.95
getMethod · 0.95
toBinOrNullMethod · 0.80
argMethod · 0.45

Tested by

no test coverage detected