/** * Get a code point iterator for a character array. * * @param chars the array * @param offs the array offset * @param len the number of characters to include * @return the code point iterator */ public static CodePointIterator ofChars(final char[] chars, final int offs, final int len) { if (len <= 0) { return EMPTY; } return new CharArrayIterator(len, chars, offs); }
public int peekNext() throws NoSuchElementException { if (! hasNext()) throw new NoSuchElementException(); return Character.codePointAt(chars, offs + idx); }
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 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 peekPrevious() throws NoSuchElementException { if (! hasPrevious()) throw new NoSuchElementException(); return Character.codePointBefore(chars, offs + idx); }
/** * Get a code point iterator for a character array. * * @param chars the array * @param offs the array offset * @param len the number of characters to include * @return the code point iterator */ public static CodePointIterator ofChars(final char[] chars, final int offs, final int len) { if (len <= 0) { return EMPTY; } return new CharArrayIterator(len, chars, offs); }
public int peekNext() throws NoSuchElementException { if (! hasNext()) throw new NoSuchElementException(); return Character.codePointAt(chars, offs + idx); }
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); }
/** * Get a code point iterator for a character array. * * @param chars the array * @param offs the array offset * @param len the number of characters to include * @return the code point iterator */ public static CodePointIterator ofChars(final char[] chars, final int offs, final int len) { if (len <= 0) { return EMPTY; } return new CharArrayIterator(len, chars, offs); }
public int peekNext() throws NoSuchElementException { if (! hasNext()) throw new NoSuchElementException(); return Character.codePointAt(chars, offs + idx); }
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 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 peekPrevious() throws NoSuchElementException { if (! hasPrevious()) throw new NoSuchElementException(); return Character.codePointBefore(chars, offs + idx); }
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 peekPrevious() throws NoSuchElementException { if (! hasPrevious()) throw new NoSuchElementException(); return Character.codePointBefore(chars, offs + idx); }