@Override public Iterable<AnnotationInterval<Object>> annotationIntervals(int start, int end, ReadableStringSet keys) { return fullAnnotationSet.annotationIntervals(start, end, keys); }
annotations.annotationIntervals(start, end, keys); return new Iterable<AnnotationInterval<String>>() { @Override
public void testIntervalIterator2() { RawAnnotationSet<Object> m = getNew(); m.begin(); m.startAnnotation("a", "1"); m.insert(1); m.endAnnotation("a"); m.insert(1); m.finish(); IntervalCallback c = mock(IntervalCallback.class); for (AnnotationInterval<Object> i : m.annotationIntervals(0, m.size(), null)) { c.apply(i.start(), i.end(), CollectionUtils.newJavaMap(i.annotations()), CollectionUtils.newJavaMap(i.diffFromLeft())); } verify(c).apply(0, 1, Collections.<String, Object>singletonMap("a", "1"), Collections.<String, Object>singletonMap("a", "1")); verify(c).apply(1, 2, Collections.<String, Object>singletonMap("a", null), Collections.<String, Object>singletonMap("a", null)); } //
public void testIntervalIterator2() { RawAnnotationSet<Object> m = getNew(); m.begin(); m.startAnnotation("a", "1"); m.insert(1); m.endAnnotation("a"); m.insert(1); m.finish(); IntervalCallback c = mock(IntervalCallback.class); for (AnnotationInterval<Object> i : m.annotationIntervals(0, m.size(), null)) { c.apply(i.start(), i.end(), CollectionUtils.newJavaMap(i.annotations()), CollectionUtils.newJavaMap(i.diffFromLeft())); } verify(c).apply(0, 1, Collections.<String, Object>singletonMap("a", "1"), Collections.<String, Object>singletonMap("a", "1")); verify(c).apply(1, 2, Collections.<String, Object>singletonMap("a", null), Collections.<String, Object>singletonMap("a", null)); } //
public void testIntervalIterator() { // IndexedDocumentImplTest contains some more tests that also exercise the // iterator methods of AnnotationTree. RawAnnotationSet<Object> m = getNew(); m.begin(); m.startAnnotation("a", "1"); m.insert(1); m.endAnnotation("a"); m.finish(); IntervalCallback c = mock(IntervalCallback.class); for (AnnotationInterval<Object> i : m.annotationIntervals(0, m.size(), null)) { c.apply(i.start(), i.end(), CollectionUtils.newJavaMap(i.annotations()), CollectionUtils.newJavaMap(i.diffFromLeft())); } verify(c).apply(0, 1, Collections.<String, Object>singletonMap("a", "1"), Collections.<String, Object>singletonMap("a", "1")); }
public void testIntervalIterator() { // IndexedDocumentImplTest contains some more tests that also exercise the // iterator methods of AnnotationTree. RawAnnotationSet<Object> m = getNew(); m.begin(); m.startAnnotation("a", "1"); m.insert(1); m.endAnnotation("a"); m.finish(); IntervalCallback c = mock(IntervalCallback.class); for (AnnotationInterval<Object> i : m.annotationIntervals(0, m.size(), null)) { c.apply(i.start(), i.end(), CollectionUtils.newJavaMap(i.annotations()), CollectionUtils.newJavaMap(i.diffFromLeft())); } verify(c).apply(0, 1, Collections.<String, Object>singletonMap("a", "1"), Collections.<String, Object>singletonMap("a", "1")); }
for (AnnotationInterval<Object> i : annotations.annotationIntervals(0, size(), knownKeys())) { i.diffFromLeft().each(new ProcV<Object>() { @Override
expectIntervals(a.annotationIntervals(0, a.size(), strs("a")), intervals( interval(0, 10, map("a", null), map()), interval(10, 15, map("a", "1"), map("a", "1")), interval(15, 36, map("a", null), map("a", null)))); expectIntervals(a.annotationIntervals(10, 26, strs("a")), intervals( interval(10, 15, map("a", "1"), map("a", "1")), interval(15, 26, map("a", null), map("a", null)))); expectIntervals(a.annotationIntervals(9, 14, strs("a")), intervals( interval(9, 10, map("a", null), map()), interval(10, 14, map("a", "1"), map("a", "1")) )); expectIntervals(a.annotationIntervals(9, 15, strs("a")), intervals( interval(9, 10, map("a", null), map()), interval(10, 15, map("a", "1"), map("a", "1")) )); expectIntervals(a.annotationIntervals(9, 16, strs("a")), intervals( interval(9, 10, map("a", null), map()), interval(10, 15, map("a", "1"), map("a", "1")), interval(15, 16, map("a", null), map("a", null)) )); expectIntervals(a.annotationIntervals(10, 14, strs("a")), intervals( interval(10, 14, map("a", "1"), map("a", "1")) )); expectIntervals(a.annotationIntervals(10, 15, strs("a")), intervals( interval(10, 15, map("a", "1"), map("a", "1")) )); expectIntervals(a.annotationIntervals(10, 16, strs("a")), intervals( interval(10, 15, map("a", "1"), map("a", "1")),
expectIntervals(a.annotationIntervals(0, a.size(), strs("a")), intervals( interval(0, 10, map("a", null), map()), interval(10, 15, map("a", "1"), map("a", "1")), interval(15, 36, map("a", null), map("a", null)))); expectIntervals(a.annotationIntervals(10, 26, strs("a")), intervals( interval(10, 15, map("a", "1"), map("a", "1")), interval(15, 26, map("a", null), map("a", null)))); expectIntervals(a.annotationIntervals(9, 14, strs("a")), intervals( interval(9, 10, map("a", null), map()), interval(10, 14, map("a", "1"), map("a", "1")) )); expectIntervals(a.annotationIntervals(9, 15, strs("a")), intervals( interval(9, 10, map("a", null), map()), interval(10, 15, map("a", "1"), map("a", "1")) )); expectIntervals(a.annotationIntervals(9, 16, strs("a")), intervals( interval(9, 10, map("a", null), map()), interval(10, 15, map("a", "1"), map("a", "1")), interval(15, 16, map("a", null), map("a", null)) )); expectIntervals(a.annotationIntervals(10, 14, strs("a")), intervals( interval(10, 14, map("a", "1"), map("a", "1")) )); expectIntervals(a.annotationIntervals(10, 15, strs("a")), intervals( interval(10, 15, map("a", "1"), map("a", "1")) )); expectIntervals(a.annotationIntervals(10, 16, strs("a")), intervals( interval(10, 15, map("a", "1"), map("a", "1")),