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

Method cpOffsets

basex-core/src/main/java/org/basex/util/Token.java:278–285  ·  view source on GitHub ↗

Returns the codepoint offsets for Unicode tokens. @param token token @return codepoint offsets, or null if the token is ASCII only

(final byte[] token)

Source from the content-addressed store, hash-verified

276 * @return codepoint offsets, or {@code null} if the token is ASCII only
277 */
278 public static int[] cpOffsets(final byte[] token) {
279 if(ascii(token)) return null;
280
281 final int tl = token.length;
282 final IntList list = new IntList(tl);
283 for(int t = 0; t < tl; t += cl(token, t)) list.add(t);
284 return list.finish();
285 }
286
287 /**
288 * Converts a character to a token.

Callers 1

asciiMethod · 0.95

Calls 4

asciiMethod · 0.95
clMethod · 0.95
addMethod · 0.95
finishMethod · 0.95

Tested by

no test coverage detected