();
+ otherDetails = new HashMap<>();
}
otherDetails.put(key, value);
- FeatureAttributes.getInstance().addAttribute(this.type, key);
+ recordAttribute(key, value);
}
}
+ /**
+ * Notifies the addition of a feature attribute. This lets us keep track of
+ * which attributes are present on each feature type, and also the range of
+ * numerical-valued attributes.
+ *
+ * @param key
+ * @param value
+ */
+ protected void recordAttribute(String key, Object value)
+ {
+ String attDesc = null;
+ if (source != null)
+ {
+ attDesc = FeatureSources.getInstance().getSource(source)
+ .getAttributeName(key);
+ }
+
+ FeatureAttributes.getInstance().addAttribute(this.type, attDesc, value,
+ key);
+ }
+
/*
* The following methods are added to maintain the castor Uniprot mapping file
* for the moment.
@@ -621,30 +637,33 @@ public class SequenceFeature implements FeatureLocationI
{
continue; // to avoid double reporting
}
- if (INFO_KEYS.containsKey(key))
+
+ Object value = entry.getValue();
+ if (value instanceof Map, ?>)
{
/*
- * split selected INFO data by delimiter over multiple lines
+ * expand values in a Map attribute across separate lines
*/
- String delimiter = INFO_KEYS.get(key);
- String[] values = entry.getValue().toString().split(delimiter);
- for (String value : values)
+ Map, ?> values = (Map, ?>) value;
+ for (Entry, ?> e : values.entrySet())
{
- sb.append(String.format(ROW_DATA, key, "", value));
+ sb.append(String.format(ROW_DATA, key, e.getKey().toString(), e
+ .getValue().toString()));
}
}
else
- { // tried but it failed to provide a tooltip :-(
+ {
+ // tried | but it failed to provide a tooltip :-(
String attDesc = null;
if (metadata != null)
{
attDesc = metadata.getAttributeName(key);
}
- String value = entry.getValue().toString();
- if (isValueInteresting(key, value, metadata))
+ String s = entry.getValue().toString();
+ if (isValueInteresting(key, s, metadata))
{
sb.append(String.format(ROW_DATA, key, attDesc == null ? ""
- : attDesc, value));
+ : attDesc, s));
}
}
}
|