/** * Move the cursor right by one char with the provided char. * * @param c the char to overwrite * @return true if it happended * @throws IOException */ boolean moveRight(char c) throws IOException { if (cursor < current.length()) { if (driver.moveRight(c)) { current.setCharAt(cursor++, c); return true; } } return false; }
int moveRightBy(int count) throws IOException, IllegalArgumentException { if (count < 0) { throw new IllegalArgumentException("Cannot move with negative count " + count); } int delta = 0; while (delta < count) { if (cursor + delta < current.length() && driver.moveRight(current.charAt(cursor + delta))) { delta++; } else { break; } } if (delta > 0) { needFlush = true; cursor += delta; } return delta; }
/** * Move the cursor right by one char with the provided char. * * @param c the char to overwrite * @return true if it happended * @throws IOException */ boolean moveRight(char c) throws IOException { if (cursor < current.length()) { if (driver.moveRight(c)) { current.setCharAt(cursor++, c); return true; } } return false; }
/** * Move the cursor right by one char with the provided char. * * @param c the char to overwrite * @return true if it happended * @throws IOException */ boolean moveRight(char c) throws IOException { if (cursor < current.length()) { if (driver.moveRight(c)) { current.setCharAt(cursor++, c); return true; } } return false; }
int moveRightBy(int count) throws IOException, IllegalArgumentException { if (count < 0) { throw new IllegalArgumentException("Cannot move with negative count " + count); } int delta = 0; while (delta < count) { if (cursor + delta < current.length() && driver.moveRight(current.charAt(cursor + delta))) { delta++; } else { break; } } if (delta > 0) { needFlush = true; cursor += delta; } return delta; }
int moveRightBy(int count) throws IOException, IllegalArgumentException { if (count < 0) { throw new IllegalArgumentException("Cannot move with negative count " + count); } int delta = 0; while (delta < count) { if (cursor + delta < current.length() && driver.moveRight(current.charAt(cursor + delta))) { delta++; } else { break; } } if (delta > 0) { needFlush = true; cursor += delta; } return delta; }