private void endChange() throws OperationException { if (currentLocation != size()) { throw new OperationException("Operation size does not match document size " + "[operation size:" + currentLocation + "] [doc size:" + size() + "]"); } annotations.finish(); checkSizeConsistency("finish"); inconsistent = false; afterFinish(); }
void insert(RawAnnotationSet<Object> a, int firstShiftedIndex, int length) throws OperationException { a.begin(); if (firstShiftedIndex > 0) { a.skip(firstShiftedIndex); } if (length > 0) { a.insert(length); } a.finish(); }
void insert(RawAnnotationSet<Object> a, int firstShiftedIndex, int length) throws OperationException { a.begin(); if (firstShiftedIndex > 0) { a.skip(firstShiftedIndex); } if (length > 0) { a.insert(length); } a.finish(); }
void insert(RawAnnotationSet<Object> a, int firstShiftedIndex, int length) throws OperationException { a.begin(); if (firstShiftedIndex > 0) { a.skip(firstShiftedIndex); } if (length > 0) { a.insert(length); } a.finish(); }
void insert(RawAnnotationSet<Object> a, int firstShiftedIndex, int length) throws OperationException { a.begin(); if (firstShiftedIndex > 0) { a.skip(firstShiftedIndex); } if (length > 0) { a.insert(length); } a.finish(); }
void delete(RawAnnotationSet<Object> a, int start, int length) throws OperationException { a.begin(); if (start > 0) { a.skip(start); } if (length > 0) { a.delete(length); } a.finish(); }
void delete(RawAnnotationSet<Object> a, int start, int length) throws OperationException { a.begin(); if (start > 0) { a.skip(start); } if (length > 0) { a.delete(length); } a.finish(); }
void delete(RawAnnotationSet<Object> a, int start, int length) throws OperationException { a.begin(); if (start > 0) { a.skip(start); } if (length > 0) { a.delete(length); } a.finish(); }
void delete(RawAnnotationSet<Object> a, int start, int length) throws OperationException { a.begin(); if (start > 0) { a.skip(start); } if (length > 0) { a.delete(length); } a.finish(); }
void setAnnotation(RawAnnotationSet<Object> a, int start, int end, String key, Object value) throws OperationException { a.begin(); if (start > 0) { a.skip(start); } a.startAnnotation(key, value); if (end - start > 0) { a.skip(end - start); } a.endAnnotation(key); a.finish(); }
void setAnnotation(RawAnnotationSet<Object> a, int start, int end, String key, Object value) throws OperationException { a.begin(); if (start > 0) { a.skip(start); } a.startAnnotation(key, value); if (end - start > 0) { a.skip(end - start); } a.endAnnotation(key); a.finish(); }
void setAnnotation(RawAnnotationSet<Object> a, int start, int end, String key, Object value) throws OperationException { a.begin(); if (start > 0) { a.skip(start); } a.startAnnotation(key, value); if (end - start > 0) { a.skip(end - start); } a.endAnnotation(key); a.finish(); }
public void testTwoInserts() { RawAnnotationSet<Object> m = getNew(); m.begin(); m.insert(1); m.insert(1); m.finish(); assertEquals(-1, m.firstAnnotationChange(0, 2, "hi", null)); }
public void testTwoInserts() { RawAnnotationSet<Object> m = getNew(); m.begin(); m.insert(1); m.insert(1); m.finish(); assertEquals(-1, m.firstAnnotationChange(0, 2, "hi", null)); }
public void testEmptySet() { RawAnnotationSet<Object> m = getNewSet(); m.begin(); m.insert(1); m.startAnnotation("a", "1"); m.insert(1); m.endAnnotation("a"); m.finish(); expectFinished(m.annotationCursor(0, m.size(), strs())); } }
public void testEmptySet() { RawAnnotationSet<Object> m = getNewSet(); m.begin(); m.insert(1); m.startAnnotation("a", "1"); m.insert(1); m.endAnnotation("a"); m.finish(); expectFinished(m.annotationCursor(0, m.size(), strs())); } }
public void testBlank() { RawAnnotationSet<Object> m = getNew(); m.begin(); m.insert(7); m.finish(); assertEquals(-1, m.firstAnnotationChange(0, 7, "hi", null)); assertEquals(-1, m.lastAnnotationChange(0, 7, "hi", null)); assertEquals(-1, m.firstAnnotationChange(1, 6, "hi", null)); assertEquals(-1, m.lastAnnotationChange(1, 6, "hi", null)); }
public void testBlank() { RawAnnotationSet<Object> m = getNew(); m.begin(); m.insert(7); m.finish(); assertEquals(-1, m.firstAnnotationChange(0, 7, "hi", null)); assertEquals(-1, m.lastAnnotationChange(0, 7, "hi", null)); assertEquals(-1, m.firstAnnotationChange(1, 6, "hi", null)); assertEquals(-1, m.lastAnnotationChange(1, 6, "hi", null)); }
public void testCreateWithSpanningAnnotation() { RawAnnotationSet<Object> m = getNew(); m.begin(); m.startAnnotation("a", "1"); m.insert(10); m.endAnnotation("a"); m.finish(); assertEquals(0, m.firstAnnotationChange(0, 10, "a", null)); assertEquals(10, m.lastAnnotationChange(0, 10, "a", null)); assertEquals(-1, m.firstAnnotationChange(0, 10, "a", "1")); assertEquals(-1, m.lastAnnotationChange(0, 10, "a", "1")); }
public void testCreateWithSpanningAnnotation() { RawAnnotationSet<Object> m = getNew(); m.begin(); m.startAnnotation("a", "1"); m.insert(10); m.endAnnotation("a"); m.finish(); assertEquals(0, m.firstAnnotationChange(0, 10, "a", null)); assertEquals(10, m.lastAnnotationChange(0, 10, "a", null)); assertEquals(-1, m.firstAnnotationChange(0, 10, "a", "1")); assertEquals(-1, m.lastAnnotationChange(0, 10, "a", "1")); }