Esempio n. 1
0
 public boolean prev() {
   if (offset > 0) {
     --offset;
     return true;
   }
   if (line.previous() != null) {
     line = line.previous();
     offset = line.length();
     return true;
   }
   return false;
 }
Esempio n. 2
0
 /**
  * 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;
   }
 }
Esempio n. 3
0
 /**
  * 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;
 }
Esempio n. 4
0
 public final Line getPreviousLine() {
   return line.previous();
 }
Esempio n. 5
0
 public boolean atStart() {
   if (line.previous() != null) return false;
   if (offset > 0) return false;
   return true;
 }