@Deprecated public int getEndCharacter() { return getEnd(); }
public boolean overlaps(final Offset i) { // Cases: // // start end // | | // 1 ####### | // 2 | ####### // 3 #################################### // 4 | ####### | // | | return (((i.getStart() <= getStart()) && (getStart() < i.getEnd())) || // Case 1-3 ((i.getStart() < getEnd()) && (getEnd() <= i.getEnd())) || // Case 1-3 ((getStart() <= i.getStart()) && (i.getEnd() <= getEnd()))); // Case 4 } @Override
private List<AnnotationSuggestion> getMatchingSuggestion(List<SuggestionGroup> aSuggestions, String aDocumentName, long aLayerId, String aFeature, int aBegin, int aEnd, String aLabel) { return aSuggestions.stream() .filter(group -> aDocumentName.equals(group.getDocumentName()) && aLayerId == group.getLayerId() && (aFeature == null || aFeature == group.getFeature()) && (aBegin == -1 || aBegin == group.getOffset().getBegin()) && (aEnd == -1 || aEnd == group.getOffset().getEnd())) .flatMap(group -> group.stream()) .filter(suggestion -> aLabel == null || aLabel.equals(suggestion.getLabel())) .collect(toList()); }
private List<AnnotationSuggestion> getMatchingSuggestion(List<SuggestionGroup> aSuggestions, String aDocumentName, long aLayerId, String aFeature, int aBegin, int aEnd, String aLabel) { return aSuggestions.stream() .filter(group -> aDocumentName.equals(group.getDocumentName()) && aLayerId == group.getLayerId() && (aFeature == null || aFeature == group.getFeature()) && (aBegin == -1 || aBegin == group.getOffset().getBegin()) && (aEnd == -1 || aEnd == group.getOffset().getEnd())) .flatMap(group -> group.stream()) .filter(suggestion -> aLabel == null || aLabel.equals(suggestion.getLabel())) .collect(toList()); }
AnnotatorState state = getModelObject(); if (state.getWindowBeginOffset() <= highlightSpan.getBegin() && highlightSpan.getEnd() <= state.getWindowEndOffset()) { aVDoc.add(new VTextMarker(this, VMarker.FOCUS, highlightSpan.getBegin() - state.getWindowBeginOffset(), highlightSpan.getEnd() - state.getWindowBeginOffset()));
AnnotatorState state = getModelObject(); if (state.getWindowBeginOffset() <= highlightSpan.getBegin() && highlightSpan.getEnd() <= state.getWindowEndOffset()) { aVDoc.add(new VTextMarker(this, VMarker.FOCUS, highlightSpan.getBegin() - state.getWindowBeginOffset(), highlightSpan.getEnd() - state.getWindowBeginOffset()));
return aWindowBegin <= offset.getBegin() && offset.getEnd() <= aWindowEnd; }) .collect(toList());