MCPcopy Index your code
hub / github.com/davidgiven/luje / codePointAt

Method codePointAt

lib/java/lang/Character.java:2178–2196  ·  view source on GitHub ↗

Returns the code point at index in the specified sequence of character units. If the unit at index is a high-surrogate unit, index + 1 is less than the length of the sequence and the unit at index + 1 is a low-surrogate unit, then the supplementary code point represen

(CharSequence seq, int index)

Source from the content-addressed store, hash-verified

2176 * @since 1.5
2177 */
2178 public static int codePointAt(CharSequence seq, int index) {
2179 if (seq == null) {
2180 throw new NullPointerException();
2181 }
2182 int len = seq.length();
2183 if (index < 0 || index >= len) {
2184 throw new StringIndexOutOfBoundsException(index);
2185 }
2186
2187 char high = seq.charAt(index++);
2188 if (index >= len) {
2189 return high;
2190 }
2191 char low = seq.charAt(index);
2192 if (isSurrogatePair(high, low)) {
2193 return toCodePoint(high, low);
2194 }
2195 return high;
2196 }
2197
2198 /**
2199 * Returns the code point at {@code index} in the specified array of

Callers 2

codePointAtMethod · 0.95
codePointAtMethod · 0.95

Calls 4

isSurrogatePairMethod · 0.95
toCodePointMethod · 0.95
lengthMethod · 0.65
charAtMethod · 0.65

Tested by

no test coverage detected