+
+ /**
+ * Answers a formatted text report of feature details
+ *
+ * @return
+ */
+ public String getDetailsReport()
+ {
+ StringBuilder sb = new StringBuilder(128);
+ if (begin == end)
+ {
+ sb.append(String.format("%s %d %s", type, begin, description));
+ }
+ else
+ {
+ sb.append(String.format("%s %d-%d %s", type, begin, end, description));
+ }
+ if (featureGroup != null)
+ {
+ sb.append(" (").append(featureGroup).append(")");
+ }
+ sb.append("\n\n");
+
+ 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
+ */
+ sb.append(key).append("=\n ");
+ String delimiter = INFO_KEYS.get(key);
+ String value = entry.getValue().toString();
+ sb.append(value.replace(delimiter, "\n "));
+ }
+ else
+ {
+ sb.append(key + "=" + entry.getValue().toString() + "\n");
+ }
+ }
+ }
+ String text = sb.toString();
+ return text;
+ }