001/* 002 * BioJava development code 003 * 004 * This code may be freely distributed and modified under the 005 * terms of the GNU Lesser General Public Licence. This should 006 * be distributed with the code. If you do not have a copy, 007 * see: 008 * 009 * http://www.gnu.org/copyleft/lesser.html 010 * 011 * Copyright for this code is held jointly by the individual 012 * authors. These should be listed in @author doc comments. 013 * 014 * For more information on the BioJava project and its aims, 015 * or to join the biojava-l mailing list, visit the home page 016 * at: 017 * 018 * http://www.biojava.org/ 019 * 020 * Created on 01-21-2010 021 */ 022 023package org.biojava.nbio.core.sequence.features; 024 025import org.biojava.nbio.core.sequence.loader.UniprotProxySequenceReader; 026 027import java.util.LinkedHashMap; 028 029/** 030 * If you have a uniprot ID then it is possible to get a collection 031 * of other id(s) that the protein is known by. This is a place holder 032 * for the alternative source database and the id for the same protein. 033 * Currently implement when the {@link UniprotProxySequenceReader} is used 034 * to load a protein sequence 035 * 036 * @author Scooter Willis <willishf at gmail dot com> 037 * @author Paolo Pavan 038 */ 039public class DBReferenceInfo extends Qualifier { 040 private LinkedHashMap<String, String> properties = new LinkedHashMap<String, String>(); 041 private String database = ""; 042 private String id = ""; 043 044 /** 045 * The source database and id 046 * @param database 047 * @param id 048 */ 049 public DBReferenceInfo(String database, String id){ 050 super("dbxref",""); 051 this.database = database; 052 this.id = id; 053 } 054 055 /** 056 * Add a property and type to associate with this DBReferenceInfo 057 * @param type 058 * @param value 059 */ 060 061 public void addProperty(String type, String value){ 062 properties.put(type, value); 063 } 064 065 /** 066 * Get the properties 067 * @return the properties 068 */ 069 public LinkedHashMap<String, String> getProperties() { 070 return properties; 071 } 072 073 /** 074 * @param properties the properties to set 075 */ 076 public void setProperties(LinkedHashMap<String, String> properties) { 077 this.properties = properties; 078 } 079 080 /** 081 * @return the database 082 */ 083 public String getDatabase() { 084 return database; 085 } 086 087 /** 088 * @param database the database to set 089 */ 090 public void setDatabase(String database) { 091 this.database = database; 092 } 093 094 /** 095 * @return the id 096 */ 097 public String getId() { 098 return id; 099 } 100 101 /** 102 * @param id the id to set 103 */ 104 public void setId(String id) { 105 this.id = id; 106 } 107 108 @Override 109 public String toString() { 110 return database + ":" + id + ":" + properties; 111 } 112 113 114 115}