@Override public int firstAnnotationChange(int start, int end, String key, String fromValue) { return doc.firstAnnotationChange(start, end, key, fromValue); }
@Override public int firstAnnotationChange(int start, int end, String key, String fromValue) { return doc.firstAnnotationChange(start, end, key, fromValue); }
/** * @return The title from the given document */ @SuppressWarnings("deprecation") public static <N, E extends N, T extends N> String extractTitle(ReadableWDocument<N, E, T> doc) { int start = doc.firstAnnotationChange(0, doc.size(), TITLE_KEY, null); if (start == -1) { return ""; } String explicitValue = doc.getAnnotation(start, TITLE_KEY); if (!explicitValue.isEmpty()) { return explicitValue; } return DocHelper.getText(doc, start, Annotations.firstAnnotationBoundary(doc, start, doc.size(), TITLE_KEY, AUTO_VALUE)); }
while (currentPos < end) { String currentValue = doc.getAnnotation(currentPos, key); int nextChange = doc.firstAnnotationChange(currentPos, end, key, currentValue); if (nextChange == -1) { nextChange = end;