JAL-1926 JAL-2106 remove startRes/endRes fields - not used
[jalview.git] / src / jalview / api / DBRefEntryI.java
1 package jalview.api;
2
3 import jalview.datamodel.Mapping;
4
5 //JBPComment: this is a datamodel API - so it should be in datamodel (it's a peer of SequenceI)
6
7 public interface DBRefEntryI
8 {
9   public boolean equalRef(DBRefEntryI entry);
10
11   /**
12    * 
13    * @return Source DB name for this entry
14    */
15   public String getSource();
16
17   /**
18    * 
19    * @return Accession Id for this entry
20    */
21   public String getAccessionId();
22
23   /**
24    * 
25    * @param accessionId
26    *          Accession Id for this entry
27    */
28   public void setAccessionId(String accessionId);
29
30   /**
31    * 
32    * @param source
33    *          Source DB name for this entry
34    */
35   public void setSource(String source);
36
37   /**
38    * 
39    * @return Source DB version for this entry
40    */
41   public String getVersion();
42
43   /**
44    * 
45    * @param version
46    *          Source DB version for this entry
47    */
48   public void setVersion(String version);
49
50   /**
51    * access a mapping, if present that can be used to map positions from the
52    * associated dataset sequence to the DBRef's sequence frame.
53    * 
54    * @return null or a valid mapping.
55    */
56   public Mapping getMap();
57
58   /**
59    * Answers true if this object is either equivalent to, or can be 'improved'
60    * by, the given entry. Specifically, answers true if
61    * <ul>
62    * <li>source and accession are identical</li>
63    * <li>version is identical, or this version is of the format "someSource:0",
64    * in which case the version for the other entry replaces it</li>
65    * <li>mappings are not compared but if this entry has no mapping, replace
66    * with that for the other entry</li>
67    * </ul>
68    * 
69    * @param otherEntry
70    * @return
71    */
72   public boolean updateFrom(DBRefEntryI otherEntry);
73 }