Changeset 164
- Timestamp:
- 08/19/09 13:33:04 (2 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 6 modified
-
bio/src/org/bridgedb/bio/BioDataSource.java (modified) (2 diffs)
-
bio/src/org/bridgedb/bio/package.html (added)
-
corelib/src/org/bridgedb/IDMapperCapabilities.java (modified) (1 diff)
-
corelib/src/org/bridgedb/file/IDMapperFile.java (modified) (4 diffs)
-
corelib/src/org/bridgedb/file/IDMapperText.java (modified) (4 diffs)
-
corelib/src/org/bridgedb/package.html (modified) (1 diff)
-
corelib/src/org/bridgedb/rdb/DBConnectorDerbyServer.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bio/src/org/bridgedb/bio/BioDataSource.java
r135 r164 28 28 import org.bridgedb.DataSourcePatterns; 29 29 30 /** 31 * Definition of many common biological DataSources. 32 * Meta data about these Data Sources, such as URL templates, 33 * are read from a bundled text file. Call the init() method 34 * at the start of your program to initialize all meta data. 35 */ 30 36 public class BioDataSource 31 37 { … … 454 460 455 461 /** 456 * @return sthe species-specific Ensembl DataSource corresponding to a given organism, or null if there isn't one known.462 * @return the species-specific Ensembl DataSource corresponding to a given organism, or null if there isn't one known. 457 463 * @param org an organism 458 464 */ -
trunk/corelib/src/org/bridgedb/IDMapperCapabilities.java
r157 r164 50 50 * 51 51 * @param src source data source 52 * @param dest target data source52 * @param tgt target data source 53 53 * @return true if mapping is supported from src to des 54 * @throws IDMapperException if service is unavailable 54 55 */ 55 public boolean isMappingSupported(DataSource src, DataSource tgt) throws IDMapperException ;56 public boolean isMappingSupported(DataSource src, DataSource tgt) throws IDMapperException; 56 57 57 58 /** -
trunk/corelib/src/org/bridgedb/file/IDMapperFile.java
r155 r164 41 41 * by default. 42 42 * @param reader ID mapping reader 43 * @throws java.io.IDMapperException when failed to read43 * @throws IDMapperException when failed to read 44 44 */ 45 45 public IDMapperFile(final IDMappingReader reader) throws IDMapperException … … 82 82 Set<DataSource> tgtDss; 83 83 if (tgtDataSources==null) { 84 tgtDss = new HashSet (cap.getSupportedTgtDataSources());84 tgtDss = new HashSet<DataSource>(cap.getSupportedTgtDataSources()); 85 85 } else { 86 tgtDss = new HashSet (tgtDataSources);86 tgtDss = new HashSet<DataSource>(tgtDataSources); 87 87 tgtDss.retainAll(supportedTgtDatasources); 88 88 } … … 108 108 Set<Xref> tgtRefs = result.get(srcXref); 109 109 if (tgtRefs==null) { 110 tgtRefs = new HashSet ();110 tgtRefs = new HashSet<Xref>(); 111 111 result.put(srcXref, tgtRefs); 112 112 } … … 160 160 private boolean isConnected = true; 161 161 // In the case of IDMapperFile, there is no need to discard associated resources. 162 163 /** {@inheritDoc} */ 162 164 public void close() throws IDMapperException { isConnected = false; } 165 /** {@inheritDoc} */ 163 166 public boolean isConnected() { return isConnected; } 164 167 -
trunk/corelib/src/org/bridgedb/file/IDMapperText.java
r156 r164 42 42 } 43 43 44 private static class Driver implements org.bridgedb.Driver 44 /** Knows how to instantiate IDMapperText. */ 45 private static final class Driver implements org.bridgedb.Driver 45 46 { 46 private Driver() {} // prevent outside instantiation; 47 /** prevent outside instantiation. */ 48 private Driver() {} 47 49 50 /** {@inheritDoc} */ 48 51 public IDMapper connect(String location) throws IDMapperException 49 52 { … … 110 113 } 111 114 115 /** 116 * parse the separator list part of the connection string. 117 * \@ or \t will be unescaped. 118 * @param config the connection string to parse 119 * @param head the section to look for, either dssep or idsep 120 * @return separators 121 */ 112 122 private char[] parseConfig(String config, String head) { 113 Set<Character> delimiters = new HashSet ();123 Set<Character> delimiters = new HashSet<Character>(); 114 124 Pattern p = Pattern.compile(head+"=(.|\\t|\\@),", 115 125 Pattern.CASE_INSENSITIVE); … … 142 152 } 143 153 144 pr otectedfinal URL url;145 pr otectedchar[] dataSourceDelimiters;146 pr otectedchar[] idDelimiters;147 pr otectedboolean transitivity;154 private final URL url; 155 private char[] dataSourceDelimiters; 156 private char[] idDelimiters; 157 private boolean transitivity; 148 158 149 159 /** … … 205 215 /** 206 216 * Free search is not supported for delimiter-text file. 217 * This will throw UnsupportedOperationException 218 * @param text ignored 219 * @param limit ignored 220 * @return does not return 221 * @throws IDMapperException will not be thrown 207 222 */ 208 223 public Set<Xref> freeSearch (String text, int limit) throws IDMapperException { -
trunk/corelib/src/org/bridgedb/package.html
r5 r164 15 15 <p> 16 16 Usually, different DataSources describe the same biological entities. Cross references are 17 stored in so called Synonym databases. {@link org.bridgedb. Gdb} has facilities for mapping cross-references17 stored in so called Synonym databases. {@link org.bridgedb.IDMapper} has facilities for mapping cross-references 18 18 and mapping between different DataSources. 19 19 <p> -
trunk/corelib/src/org/bridgedb/rdb/DBConnectorDerbyServer.java
r147 r164 29 29 30 30 /** 31 * Database connector that connects to a Derby database server 31 * Database connector that connects to a Derby database server. 32 32 */ 33 33 public class DBConnectorDerbyServer extends DBConnector { … … 35 35 static private String host; 36 36 static private int port; 37 static boolean inited = false;37 static private boolean inited = false; 38 38 39 39 /** 40 * Initialize global settings that will be shared by all instances of DBConnectorDerbyServer 41 * @param host The host on which the database resides42 * @param port The port to create the connection on40 * Initialize global settings that will be shared by all instances of DBConnectorDerbyServer. 41 * @param aHost The host on which the database resides 42 * @param aPort The port to create the connection on 43 43 */ 44 44 static public void init (String aHost, int aPort)
