+ /**
+ * update entry with details from another entry concerning the same PDB
+ * ID/file spec.
+ *
+ * @param newEntry
+ * @return true if modifications were made
+ */
+ public boolean updateFrom(PDBEntry newEntry)
+ {
+ boolean modified = false;
+
+ if (getFile() == null)
+ {
+ // update file and type of file
+ modified = newEntry.getFile() != null;
+ setFile(newEntry.getFile());
+ }
+ if (newEntry.getType() != null && newEntry.getFile() != null
+ && newEntry.getFile().equals(getFile()))
+ {
+ setType(newEntry.getType());
+ }
+ if (getChainCode() == null
+ || (getChainCode() != null && getChainCode().length() == 0 && newEntry
+ .getChainCode() != null))
+ {
+ modified |= (getChainCode() == null || !newEntry.getChainCode()
+ .equals(getChainCode()));
+ setChainCode(newEntry.getChainCode());
+ }
+ if (newEntry.properties != null)
+ {
+ for (Entry<String, Object> entry : newEntry.properties.entrySet())
+ {
+ if (!entry.getValue().equals(getProperty(entry.getKey())))
+ {
+ modified = true;
+ }
+ setProperty(entry.getKey(), entry.getValue());
+ }
+ }
+ return modified;
+ }