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

Method index

basex-core/src/main/java/org/basex/query/util/hash/QNmSet.java:64–70  ·  view source on GitHub ↗

Returns the index of the specified key. @param key key to be looked up @return index, or 0 if key does not exist

(final QNm key)

Source from the content-addressed store, hash-verified

62 * @return index, or {@code 0} if key does not exist
63 */
64 public final int index(final QNm key) {
65 final int b = key.hashCode() & capacity() - 1;
66 for(int i = buckets[b]; i != 0; i = next[i]) {
67 if(key.eq(keys[i])) return i;
68 }
69 return 0;
70 }
71
72 /**
73 * Stores the specified key and returns its index,

Callers 1

containsMethod · 0.95

Calls 3

capacityMethod · 0.80
eqMethod · 0.65
hashCodeMethod · 0.45

Tested by

no test coverage detected