Return a the subset of annotations from the given annotation set that start exactly at the given offset. @param annotationSet the set of annotations from which to select @param atOffset the offset where the annoation to be returned should start @return an annotation set containing all the annotatio
(
AnnotationSet annotationSet, Long atOffset)
| 323 | * set that start at the given offset |
| 324 | */ |
| 325 | public static AnnotationSet getAnnotationsAtOffset( |
| 326 | AnnotationSet annotationSet, Long atOffset) { |
| 327 | // this returns all annotations that start at this atOffset OR AFTER! |
| 328 | AnnotationSet tmp = annotationSet.get(atOffset); |
| 329 | // so lets filter ... |
| 330 | List<Annotation> ret = new ArrayList<Annotation>(); |
| 331 | Iterator<Annotation> it = tmp.iterator(); |
| 332 | while(it.hasNext()) { |
| 333 | Annotation ann = it.next(); |
| 334 | if(ann.getStartNode().getOffset().equals(atOffset)) { |
| 335 | ret.add(ann); |
| 336 | } |
| 337 | } |
| 338 | return Factory.createImmutableAnnotationSet(annotationSet.getDocument(), ret); |
| 339 | } |
| 340 | |
| 341 | public static AnnotationSet getAnnotationsEndingAtOffset(AnnotationSet annotationSet, Long endOffset) { |
| 342 | List<Annotation> endsAt = new ArrayList<Annotation>(); |
no test coverage detected