package jalview.datamodel;
import jalview.datamodel.features.FeatureAttributeType;
+import jalview.datamodel.features.FeatureAttributes;
import jalview.datamodel.features.FeatureLocationI;
import jalview.datamodel.features.FeatureSourceI;
import jalview.datamodel.features.FeatureSources;
}
/**
+ * Answers the value of the specified attribute as string, or null if no such
+ * value
+ *
+ * @param key
+ * @return
+ */
+ public String getValueAsString(String key)
+ {
+ if (otherDetails == null)
+ {
+ return null;
+ }
+ Object value = otherDetails.get(key);
+ return value == null ? null : value.toString();
+ }
+
+ /**
* Returns a property value for the given key if known, else the specified
* default value
*
}
otherDetails.put(key, value);
+ 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, key, attDesc,
+ value.toString());
+ }
+
/*
* The following methods are added to maintain the castor Uniprot mapping file
* for the moment.