+
+ /**
+ * Answers an html-formatted report of feature details
+ *
+ * @return
+ */
+ public String getDetailsReport()
+ {
+ StringBuilder sb = new StringBuilder(128);
+ sb.append("<br>");
+ sb.append("<table>");
+ sb.append(String.format(ROW_DATA, "Type", type));
+ sb.append(String.format(ROW_DATA, "Start/end", begin == end ? begin
+ : begin + (isContactFeature() ? ":" : "-") + end));
+ String desc = StringUtils.stripHtmlTags(description);
+ sb.append(String.format(ROW_DATA, "Description", desc));
+ if (!Float.isNaN(score) && score != 0f)
+ {
+ sb.append(String.format(ROW_DATA, "Score", score));
+ }
+ if (featureGroup != null)
+ {
+ sb.append(String.format(ROW_DATA, "Group", featureGroup));
+ }
+
+ if (otherDetails != null)
+ {
+ TreeMap<String, Object> ordered = new TreeMap<>(
+ String.CASE_INSENSITIVE_ORDER);
+ ordered.putAll(otherDetails);
+
+ for (Entry<String, Object> entry : ordered.entrySet())
+ {
+ String key = entry.getKey();
+ if (ATTRIBUTES.equals(key))
+ {
+ continue; // to avoid double reporting
+ }
+ if (INFO_KEYS.containsKey(key))
+ {
+ /*
+ * split selected INFO data by delimiter over multiple lines
+ */
+ String delimiter = INFO_KEYS.get(key);
+ String[] values = entry.getValue().toString().split(delimiter);
+ for (String value : values)
+ {
+ sb.append("<tr><td>").append(key).append("</td><td>")
+ .append(value)
+ .append("</td></tr>");
+ }
+ }
+ else
+ { // tried <td title="key"> but it failed to provide a tooltip :-(
+ sb.append("<tr><td>").append(key).append("</td><td>");
+ sb.append(entry.getValue().toString()).append("</td></tr>");
+ }
+ }
+ }
+ sb.append("</table>");
+
+ String text = sb.toString();
+ return text;
+ }