Changeset 106
- Timestamp:
- 07/19/09 19:24:43 (3 years ago)
- Location:
- trunk/corelib/src/org/bridgedb
- Files:
-
- 8 modified
-
file/IDMapperFile.java (modified) (3 diffs)
-
file/IDMapperText.java (modified) (3 diffs)
-
file/IDMappingReader.java (modified) (2 diffs)
-
file/IDMappingReaderFromDelimitedReader.java (modified) (2 diffs)
-
file/IDMappingReaderFromText.java (modified) (2 diffs)
-
rdb/DBConnector.java (modified) (7 diffs)
-
rdb/SimpleGdb.java (modified) (1 diff)
-
rdb/SimpleGdbImpl2.java (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/corelib/src/org/bridgedb/file/IDMapperFile.java
r105 r106 17 17 package org.bridgedb.file; 18 18 19 import java.util.List; 20 import java.util.Set; 19 import java.util.HashMap; 21 20 import java.util.HashSet; 22 21 import java.util.Map; 23 import java.util.HashMap; 24 25 import java.io.IOException; 22 import java.util.Set; 26 23 27 24 import org.bridgedb.DataSource; … … 32 29 33 30 /** 34 * Interface for ID mapping from files 31 * Interface for ID mapping from files. 35 32 * 36 33 */ … … 189 186 } 190 187 188 /** {@inheritDoc} */ 191 189 public boolean isFreeSearchSupported() { 192 190 return freeSearch; 193 191 } 194 192 193 /** {@inheritDoc} */ 195 194 public Set<DataSource> getSupportedSrcDataSources() throws IDMapperException { 196 195 return IDMapperFile.this.reader.getDataSources(); 197 196 } 198 197 198 /** {@inheritDoc} */ 199 199 public Set<DataSource> getSupportedTgtDataSources() throws IDMapperException { 200 200 return getSupportedSrcDataSources(); // -
trunk/corelib/src/org/bridgedb/file/IDMapperText.java
r105 r106 17 17 package org.bridgedb.file; 18 18 19 import java.util.HashSet; 19 20 import java.util.Set; 20 import java.util.HashSet;21 21 22 22 import java.util.regex.Matcher; … … 27 27 28 28 import org.bridgedb.BridgeDb; 29 import org.bridgedb.Driver;30 29 import org.bridgedb.IDMapper; 31 30 import org.bridgedb.IDMapperException; … … 33 32 34 33 /** 35 * Class for mapping ID from delimited text file 34 * Class for mapping ID from delimited text file. 36 35 * @author gjj 37 36 */ -
trunk/corelib/src/org/bridgedb/file/IDMappingReader.java
r105 r106 17 17 package org.bridgedb.file; 18 18 19 import java.util.Map; 19 20 import java.util.Set; 20 import java.util.Map;21 21 22 22 import org.bridgedb.DataSource; … … 26 26 27 27 /** 28 * Interface for reading ID mapping data 28 * Interface for reading ID mapping data. 29 29 * 30 30 */ -
trunk/corelib/src/org/bridgedb/file/IDMappingReaderFromDelimitedReader.java
r105 r106 17 17 package org.bridgedb.file; 18 18 19 import java.util.Vector; 20 import java.util.Set; 19 import java.io.BufferedReader; 20 import java.io.IOException; 21 import java.io.Reader; 22 23 import java.util.HashMap; 21 24 import java.util.HashSet; 22 25 import java.util.Map; 23 import java.util.HashMap; 24 25 import java.io.Reader; 26 import java.io.BufferedReader; 27 import java.io.IOException; 26 import java.util.Set; 27 import java.util.Vector; 28 28 29 29 import org.bridgedb.DataSource; … … 32 32 33 33 /** 34 * Class for reading ID mapping data from delimited buffered reader 34 * Class for reading ID mapping data from delimited buffered reader. 35 35 * @author gjj 36 36 */ -
trunk/corelib/src/org/bridgedb/file/IDMappingReaderFromText.java
r105 r106 17 17 package org.bridgedb.file; 18 18 19 import java.io.IOException; 20 import java.io.InputStream; 21 import java.io.InputStreamReader; 19 22 import java.io.Reader; 20 import java.io.InputStreamReader;21 import java.io.InputStream;22 import java.io.IOException;23 23 24 import java.net.URL; 24 25 import java.net.URLConnection; 25 import java.net.URL;26 26 27 27 import org.bridgedb.IDMapperException; … … 29 29 30 30 /** 31 * Class for reading ID mapping data from delimited text file 31 * Class for reading ID mapping data from delimited text file. 32 32 * @author gjj 33 33 */ -
trunk/corelib/src/org/bridgedb/rdb/DBConnector.java
r105 r106 42 42 43 43 /** 44 * Type for gene database 44 * Type for gene database. 45 45 */ 46 46 public static final int TYPE_GDB = 0; 47 47 /** 48 * Type for expression database 48 * Type for expression database. 49 49 */ 50 50 public static final int TYPE_GEX = 1; … … 53 53 54 54 /** 55 * Close the given connection 55 * Close the given connection. 56 56 * @param con The connection to be closed 57 * @throws Exception57 * @throws IDMapperException when there was a database error 58 58 */ 59 59 public void closeConnection(Connection con) throws IDMapperException … … 63 63 64 64 /** 65 * Close the given connection, and optionally finalize it after creation (using {@link #PROP_FINALIZE}) 65 * Close the given connection, and optionally finalize it after creation (using {@link #PROP_FINALIZE}). 66 66 * @param con The connection to be closed 67 67 * @param props Close properties (one of {@link #PROP_NONE}, {@link #PROP_FINALIZE} or {@link #PROP_RECREATE}) 68 * @throws Exception68 * @throws IDMapperException when there was a database error 69 69 */ 70 70 public void closeConnection(Connection con, int props) throws IDMapperException … … 83 83 84 84 /** 85 * Set the database type (one of {@link #TYPE_GDB} or {@link #TYPE_GEX}) 85 * Set the database type (one of {@link #TYPE_GDB} or {@link #TYPE_GEX}). 86 86 * @param type The type of the database that will be used for this class 87 87 */ … … 89 89 90 90 /** 91 * Get the database type (one of {@link #TYPE_GDB} or {@link #TYPE_GEX}) 92 * return The type of the database that is used for this class91 * Get the database type (one of {@link #TYPE_GDB} or {@link #TYPE_GEX}). 92 * @return The type of the database that is used for this class 93 93 */ 94 94 public int getDbType() { return dbType; } 95 95 96 97 98 96 /** 99 97 * This method is called to finalize the given database after creation … … 103 101 * The database connection needs to be closed before running this method. 104 102 * @param dbName The name of the database to finalize 105 * @throws Exception106 103 * @return The name of the finalized database 104 * @throws IDMapperException when there was a database error 107 105 */ 108 106 public abstract String finalizeNewDatabase(String dbName) throws IDMapperException; … … 113 111 * after all data is added to the database. 114 112 * @param con A connection to the database 115 * @throws SQLException113 * @throws IDMapperException when there was a database error 116 114 */ 117 115 public void compact(Connection con) throws IDMapperException -
trunk/corelib/src/org/bridgedb/rdb/SimpleGdb.java
r105 r106 20 20 import java.sql.ResultSet; 21 21 import java.sql.SQLException; 22 import java.util.List;23 22 24 23 import org.bridgedb.IDMapperException; 25 import org.bridgedb.Xref;26 24 27 25 /** -
trunk/corelib/src/org/bridgedb/rdb/SimpleGdbImpl2.java
r105 r106 103 103 "id = ? AND code = ?" 104 104 ); 105 private final LazyPst pstGeneSymbol = new LazyPst(106 "SELECT attrvalue FROM attribute WHERE " +107 "attrname = 'Symbol' AND id = ? " +108 "AND code = ?"109 );110 105 private final LazyPst pstBackpage = new LazyPst( 111 106 "SELECT backpageText FROM datanode " + … … 165 160 * get Backpage info. In Schema v2, this was not stored in 166 161 * the attribute table but as a separate column, so this is treated 167 * as a special case. 162 * as a special case. This method is called by <pre>getAttribute (ref, "Backpage")</pre> 163 * @param ref the entity to get backpage info for. 164 * @return Backpage info as string 165 * @throws IDMapperException when database is unavailable 168 166 */ 169 167 private String getBpInfo(Xref ref) throws IDMapperException … … 245 243 /** 246 244 * Opens a connection to the Gene Database located in the given file. 245 * A new instance of this class is created automatically. 247 246 * @param dbName The file containing the Gene Database. 248 * @param connector An instance of DBConnector, to determine the type of database (e.g. DataDerby). 249 * A new instance of this class is created automatically. 247 * @param newDbConnector An instance of DBConnector, to determine the type of database (e.g. DataDerby). 248 * @param props PROP_RECREATE if you want to create a new database (possibly overwriting an existing one) 249 * or PROP_NONE if you want to connect read-only 250 * @throws IDMapperException when the database could not be created or connected to 250 251 */ 251 252 public SimpleGdbImpl2(String dbName, DBConnector newDbConnector, int props) throws IDMapperException … … 539 540 /** 540 541 * @return a list of data sources present in this database. 542 @throws IDMapperException when the database is unavailable 541 543 */ 542 544 private Set<DataSource> getDataSources() throws IDMapperException
