/** * Gets the maximum number of annotations within the specified containers. * * @param containers * the containers to scan for the upper bound * @return the maximum number of annotations */ public int getUpperBound(final Collection<? extends AnnotationContainer> containers) { int maximum = 0; for (AnnotationContainer container : containers) { maximum = Math.max(maximum, container.getNumberOfAnnotations()); } return maximum; }
/** * Gets the maximum number of annotations within the specified containers. * * @param containers * the containers to scan for the upper bound * @return the maximum number of annotations */ public int getUpperBound(final Collection<? extends AnnotationContainer> containers) { int maximum = 0; for (AnnotationContainer container : containers) { maximum = Math.max(maximum, container.getNumberOfAnnotations()); } return maximum; }
@Override public String toString() { return getName() + ": " + getNumberOfAnnotations() + " annotations"; } }
@Override public String toString() { return getName() + ": " + getNumberOfAnnotations() + " annotations"; } }
@Override public final int getNumberOfAnnotations(final String priority) { return getNumberOfAnnotations(getPriority(priority)); }
/** {@inheritDoc} */ public final int getNumberOfAnnotations(final String priority) { return getNumberOfAnnotations(getPriority(priority)); }
private int computeDelta(final ParserResult result, final AnnotationContainer referenceResult, final Priority priority) { return result.getNumberOfAnnotations(priority) - referenceResult.getNumberOfAnnotations(priority); }
private int computeDelta(final ParserResult result, final AnnotationContainer referenceResult, final Priority priority) { return result.getNumberOfAnnotations(priority) - referenceResult.getNumberOfAnnotations(priority); }
/** * Returns the actually used priorities. * * @return the actually used priorities. */ public Priority[] getPriorities() { List<Priority> actualPriorities = new ArrayList<Priority>(); for (String priority : getAvailablePriorities()) { if (provider.getNumberOfAnnotations(priority) > 0) { actualPriorities.add(Priority.fromString(priority)); } } return actualPriorities.toArray(new Priority[actualPriorities.size()]); }
/** * Returns a tooltip showing the distribution of priorities for this container. * * @return a tooltip showing the distribution of priorities */ public String getToolTip() { StringBuilder message = new StringBuilder(); String separator = " - "; for (Priority priority : Priority.values()) { if (hasAnnotations(priority)) { message.append(priority.getLocalizedString()); message.append(":"); message.append(getNumberOfAnnotations(priority)); message.append(separator); } } return StringUtils.removeEnd(message.toString(), separator); }
/** * Returns a tooltip showing the distribution of priorities for this container. * * @return a tooltip showing the distribution of priorities */ public String getToolTip() { StringBuilder message = new StringBuilder(); String separator = " - "; for (Priority priority : Priority.values()) { if (hasAnnotations(priority)) { message.append(priority.getLocalizedString()); message.append(':'); message.append(getNumberOfAnnotations(priority)); message.append(separator); } } return StringUtils.removeEnd(message.toString(), separator); }
AnnotationContainer referenceResult = history.getReferenceAnnotations(); delta = result.getNumberOfAnnotations() - referenceResult.getNumberOfAnnotations(); lowDelta = computeDelta(result, referenceResult, Priority.LOW); normalDelta = computeDelta(result, referenceResult, Priority.NORMAL);
AnnotationContainer referenceResult = history.getReferenceAnnotations(); delta = result.getNumberOfAnnotations() - referenceResult.getNumberOfAnnotations(); lowDelta = computeDelta(result, referenceResult, Priority.LOW); normalDelta = computeDelta(result, referenceResult, Priority.NORMAL);