X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FPDBEntry.java;h=741ef0774cd9ed2ec3ed9463089215f51ff61e42;hb=584ab9644955bec02d96448361b8aac5b9542599;hp=adcefb3826530d567d1b9de69a3d7ee8a404d8b5;hpb=b334bfb75ddd402fa7368873f4c25cffae0b1740;p=jalview.git diff --git a/src/jalview/datamodel/PDBEntry.java b/src/jalview/datamodel/PDBEntry.java index adcefb3..741ef07 100755 --- a/src/jalview/datamodel/PDBEntry.java +++ b/src/jalview/datamodel/PDBEntry.java @@ -38,7 +38,14 @@ public class PDBEntry private static final int PDB_ID_LENGTH = 4; + /** + * property set when id is a 'manufactured' identifier from the structure data's filename + */ private static final String FAKED_ID = "faked_pdbid"; + /** + * property set when the id is authoritative, and should be used in preference to any identifiers in the structure data + */ + private static final String AUTHORITATIVE_ID = "authoritative_pdbid"; private String file; @@ -406,7 +413,7 @@ public class PDBEntry // this shouldn't happen, but could do if the id from the // file is not the same as the id from the authority that provided // the file - if (!newEntry.fakedPDBId()) + if (!newEntry.fakedPDBId() && !isAuthoritative()) { return false; } // otherwise we can update @@ -474,7 +481,7 @@ public class PDBEntry */ String key = newProps.nextElement(); Object value = newEntry.getProperty(key); - if (FAKED_ID.equals(key)) + if (FAKED_ID.equals(key) || AUTHORITATIVE_ID.equals(key)) { // we never update the fake ID property continue; @@ -487,6 +494,25 @@ public class PDBEntry return true; } + public void setAuthoritative(boolean isAuthoritative) + { + setProperty(AUTHORITATIVE_ID, Boolean.valueOf(isAuthoritative)); + } + + /** + * + * @return true if the identifier should be preferred over any identifiers + * embedded in the structure data + */ + public boolean isAuthoritative() + { + if (_hasProperty(AUTHORITATIVE_ID)) + { + return ((Boolean)getProperty(AUTHORITATIVE_ID)); + } + return false; + } + /** * set when Jalview has manufactured the ID using a local filename * @return