/** {@inheritDoc} */ public void annotate(int amt, String msg) { if (annotations == null) { return; } endAnnotation(); int asz = annotations.size(); int lastEnd = (asz == 0) ? 0 : annotations.get(asz - 1).getEnd(); int startAt; if (lastEnd <= cursor) { startAt = cursor; } else { startAt = lastEnd; } annotations.add(new Annotation(startAt, startAt + amt, msg)); }
/** {@inheritDoc} */ public void endAnnotation() { if (annotations == null) { return; } int sz = annotations.size(); if (sz != 0) { annotations.get(sz - 1).setEndIfUnset(cursor); } }
/** * Finishes up annotation processing. This closes off any open * annotations and removes annotations that don't refer to written * data. */ public void finishAnnotating() { // Close off the final annotation, if any. endAnnotation(); // Remove annotations that refer to unwritten data. if (annotations != null) { int asz = annotations.size(); while (asz > 0) { Annotation last = annotations.get(asz - 1); if (last.getStart() > cursor) { annotations.remove(asz - 1); asz--; } else if (last.getEnd() > cursor) { last.setEnd(cursor); break; } else { break; } } } }
/** * Finishes up annotation processing. This closes off any open * annotations and removes annotations that don't refer to written * data. */ public void finishAnnotating() { // Close off the final annotation, if any. endAnnotation(); // Remove annotations that refer to unwritten data. if (annotations != null) { int asz = annotations.size(); while (asz > 0) { Annotation last = annotations.get(asz - 1); if (last.getStart() > cursor) { annotations.remove(asz - 1); asz--; } else if (last.getEnd() > cursor) { last.setEnd(cursor); break; } else { break; } } } }
/** * Finishes up annotation processing. This closes off any open * annotations and removes annotations that don't refer to written * data. */ public void finishAnnotating() { // Close off the final annotation, if any. endAnnotation(); // Remove annotations that refer to unwritten data. if (annotations != null) { int asz = annotations.size(); while (asz > 0) { Annotation last = annotations.get(asz - 1); if (last.getStart() > cursor) { annotations.remove(asz - 1); asz--; } else if (last.getEnd() > cursor) { last.setEnd(cursor); break; } else { break; } } } }
/** * Finishes up annotation processing. This closes off any open * annotations and removes annotations that don't refer to written * data. */ public void finishAnnotating() { // Close off the final annotation, if any. endAnnotation(); // Remove annotations that refer to unwritten data. if (annotations != null) { int asz = annotations.size(); while (asz > 0) { Annotation last = annotations.get(asz - 1); if (last.getStart() > cursor) { annotations.remove(asz - 1); asz--; } else if (last.getEnd() > cursor) { last.setEnd(cursor); break; } else { break; } } } }
/** * Finishes up annotation processing. This closes off any open * annotations and removes annotations that don't refer to written * data. */ public void finishAnnotating() { // Close off the final annotation, if any. endAnnotation(); // Remove annotations that refer to unwritten data. if (annotations != null) { int asz = annotations.size(); while (asz > 0) { Annotation last = annotations.get(asz - 1); if (last.getStart() > cursor) { annotations.remove(asz - 1); asz--; } else if (last.getEnd() > cursor) { last.setEnd(cursor); break; } else { break; } } } }
/** * Finishes up annotation processing. This closes off any open * annotations and removes annotations that don't refer to written * data. */ public void finishAnnotating() { // Close off the final annotation, if any. endAnnotation(); // Remove annotations that refer to unwritten data. if (annotations != null) { int asz = annotations.size(); while (asz > 0) { Annotation last = annotations.get(asz - 1); if (last.getStart() > cursor) { annotations.remove(asz - 1); asz--; } else if (last.getEnd() > cursor) { last.setEnd(cursor); break; } else { break; } } } }
/** * Finishes up annotation processing. This closes off any open * annotations and removes annotations that don't refer to written * data. */ public void finishAnnotating() { // Close off the final annotation, if any. endAnnotation(); // Remove annotations that refer to unwritten data. if (annotations != null) { int asz = annotations.size(); while (asz > 0) { Annotation last = annotations.get(asz - 1); if (last.getStart() > cursor) { annotations.remove(asz - 1); asz--; } else if (last.getEnd() > cursor) { last.setEnd(cursor); break; } else { break; } } } }
/** * Finishes up annotation processing. This closes off any open * annotations and removes annotations that don't refer to written * data. */ public void finishAnnotating() { // Close off the final annotation, if any. endAnnotation(); // Remove annotations that refer to unwritten data. if (annotations != null) { int asz = annotations.size(); while (asz > 0) { Annotation last = annotations.get(asz - 1); if (last.getStart() > cursor) { annotations.remove(asz - 1); asz--; } else if (last.getEnd() > cursor) { last.setEnd(cursor); break; } else { break; } } } }
/** {@inheritDoc} */ public void annotate(int amt, String msg) { if (annotations == null) { return; } endAnnotation(); int asz = annotations.size(); int lastEnd = (asz == 0) ? 0 : annotations.get(asz - 1).getEnd(); int startAt; if (lastEnd <= cursor) { startAt = cursor; } else { startAt = lastEnd; } annotations.add(new Annotation(startAt, startAt + amt, msg)); }
/** {@inheritDoc} */ public void annotate(int amt, String msg) { if (annotations == null) { return; } endAnnotation(); int asz = annotations.size(); int lastEnd = (asz == 0) ? 0 : annotations.get(asz - 1).getEnd(); int startAt; if (lastEnd <= cursor) { startAt = cursor; } else { startAt = lastEnd; } annotations.add(new Annotation(startAt, startAt + amt, msg)); }