public boolean prev() { if (offset > 0) { --offset; return true; } if (line.previous() != null) { line = line.previous(); offset = line.length(); return true; } return false; }
/** * Appends the given line to this block. * * @param line Line to append. */ public void appendLine(final Line line) { if (this.lineTail == null) { this.lines = this.lineTail = line; } else { this.lineTail.nextEmpty = line.isEmpty; line.prevEmpty = this.lineTail.isEmpty; line.previous = this.lineTail; this.lineTail.next = line; this.lineTail = line; } }
/** * Removes the given line from this block. * * @param line Line to remove. */ public void removeLine(final Line line) { if (line.previous == null) { this.lines = line.next; } else { line.previous.next = line.next; } if (line.next == null) { this.lineTail = line.previous; } else { line.next.previous = line.previous; } line.previous = line.next = null; }
public final Line getPreviousLine() { return line.previous(); }
public boolean atStart() { if (line.previous() != null) return false; if (offset > 0) return false; return true; }