/** Returns the index that is offset {@code codePointOffset} code points from {@code index}. * * @param index the index to calculate the offset from. * @param codePointOffset the number of code points to count. * @return the index that is {@code codePointOffset} code points away from index. * @throws IndexOutOfBoundsException if {@code index} is negative or greater than {@link #length()} or if there aren't enough * code points before or after {@code index} to match {@code codePointOffset}. * @see Character * @see Character#offsetByCodePoints(char[], int, int, int, int) * @since 1.5 */ public int offsetByCodePoints (int index, int codePointOffset) { return Character.offsetByCodePoints(chars, 0, length, index, codePointOffset); }
/** Returns the index that is offset {@code codePointOffset} code points from {@code index}. * * @param index the index to calculate the offset from. * @param codePointOffset the number of code points to count. * @return the index that is {@code codePointOffset} code points away from index. * @throws IndexOutOfBoundsException if {@code index} is negative or greater than {@link #length()} or if there aren't enough * code points before or after {@code index} to match {@code codePointOffset}. * @see Character * @see Character#offsetByCodePoints(char[], int, int, int, int) * @since 1.5 */ public int offsetByCodePoints (int index, int codePointOffset) { return Character.offsetByCodePoints(chars, 0, length, index, codePointOffset); }
/** * Returns the index within this object that is offset from {@code index} by * {@code codePointOffset} code points. * * @param index * the index within this object to calculate the offset from. * @param codePointOffset * the number of code points to count. * @return the index within this object that is the offset. * @throws IndexOutOfBoundsException * if {@code index} is negative or greater than {@code length()} * or if there aren't enough code points before or after {@code * index} to match {@code codePointOffset}. * @since 1.5 */ public int offsetByCodePoints(int index, int codePointOffset) { int s = index + offset; int r = Character.offsetByCodePoints(value, offset, count, s, codePointOffset); return r - offset; }
/** * Returns the index that is offset {@code codePointOffset} code points from * {@code index}. * * @param index * the index to calculate the offset from. * @param codePointOffset * the number of code points to count. * @return the index that is {@code codePointOffset} code points away from * index. * @throws IndexOutOfBoundsException * if {@code index} is negative or greater than * {@link #length()} or if there aren't enough code points * before or after {@code index} to match * {@code codePointOffset}. * @see Character * @see Character#offsetByCodePoints(char[], int, int, int, int) * @since 1.5 */ public int offsetByCodePoints(int index, int codePointOffset) { return Character.offsetByCodePoints(value, 0, count, index, codePointOffset); } }
public int previous() { if (! hasPrevious()) throw new NoSuchElementException(); idx = Character.offsetByCodePoints(chars, offs, len, offs + idx, - 1) - offs; offset--; return Character.codePointAt(chars, offs + idx); }
public int prev() { if (! hasPrev()) throw new NoSuchElementException(); idx = Character.offsetByCodePoints(chars, offs, len, offs + idx, -1) - offs; offset--; return Character.codePointAt(chars, offs + idx); }
/** * Utility method to take a string and convert it to normal Java variable name capitalization. * * @param name The string to be made in camel case. * @return The camel case version of the string. */ public static String decapitalize(String name) { if (name == null || name.length() == 0) { return name; } int offset1 = Character.offsetByCodePoints(name, 0, 1); if (offset1 < name.length() && Character.isUpperCase(name.codePointAt(offset1))) return name; return name.substring(0, offset1).toLowerCase() + name.substring(offset1); }
public int next() { if (! hasNext()) throw new NoSuchElementException(); try { offset++; return Character.codePointAt(chars, offs + idx); } finally { idx = Character.offsetByCodePoints(chars, offs, len, offs + idx, 1) - offs; } }
public int next() { if (! hasNext()) throw new NoSuchElementException(); try { offset++; return Character.codePointAt(chars, offs + idx); } finally { idx = Character.offsetByCodePoints(chars, offs, len, offs + idx, 1) - offs; } }
case 8: zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzMarkedPos, -1); case 9: zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 2);
case 13: zzMarkedPos = Character.offsetByCodePoints (zzBufferL/*, zzStartRead, zzEndRead - zzStartRead*/, zzMarkedPos, -3); { yybegin(YYINITIAL);
case 23: zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzMarkedPos, -1); { return getNext(); case 31: zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzMarkedPos, -1); { String txt = yytext(); case 36: zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzMarkedPos, -2); { return getNext();
case 19: zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzMarkedPos, -1); { return getNext(); case 30: zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzMarkedPos, -2); { return getNext();
case 20: zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 1); { chkLOC(); yybegin(TBLL);
case 17: zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 3); { yypush(JAVADOC);
case 15: zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzMarkedPos, -1); { chkLOC(); case 18: zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzMarkedPos, -1); { chkLOC(); case 19: zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 2); { chkLOC(); case 20: zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzMarkedPos, -2); { chkLOC(); zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 2); { chkLOC();
case 21: zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 3); { if (nestedComment++ == 0) {
case 19: zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 1); { h.chkLOC(); case 26: zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 1); { h.chkLOC();
case 19: zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 1); { h.chkLOC(); case 26: zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 1); { h.chkLOC();
case 20: zzMarkedPos = Character.offsetByCodePoints (zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 3); { if (nestedComment++ == 0) {