Changeset 157

Show
Ignore:
Timestamp:
08/15/09 09:16:27 (2 years ago)
Author:
jgao
Message:

boolean isMappingSupported(src, tgt) in IDMapperCapabilities

Location:
trunk/corelib/src/org/bridgedb
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/corelib/src/org/bridgedb/AbstractIDMapperCapabilities.java

    r129 r157  
    8080        } 
    8181 
     82        /** {@inheritDoc} */ 
     83        public boolean isMappingSupported(DataSource src, DataSource tgt) 
     84                        throws IDMapperException  { 
     85            return getSupportedSrcDataSources().contains(src) 
     86                    && getSupportedTgtDataSources().contains(tgt); 
     87        } 
     88 
    8289        /** {@inheritDoc} */ 
    8390        public boolean isFreeSearchSupported()  
  • trunk/corelib/src/org/bridgedb/IDMapperCapabilities.java

    r129 r157  
    4646     */ 
    4747    public Set<DataSource> getSupportedTgtDataSources() throws IDMapperException; 
     48 
     49    /** 
     50     * 
     51     * @param src source data source 
     52     * @param dest target data source 
     53     * @return true if mapping is supported from src to des 
     54     */ 
     55    public boolean isMappingSupported(DataSource src, DataSource tgt) throws IDMapperException ; 
    4856     
    4957    /** 
  • trunk/corelib/src/org/bridgedb/IDMapperStack.java

    r129 r157  
    176176                } 
    177177 
     178                /** {@inheritDoc} */ 
     179                public boolean isMappingSupported(DataSource src, DataSource tgt) 
     180                                throws IDMapperException { 
     181                    for (IDMapper idm : IDMapperStack.this.gdbs) 
     182                    { 
     183                        if (idm.getCapabilities().isMappingSupported(src, tgt)) { 
     184                            return true; 
     185                        } 
     186                    } 
     187                    return false; 
     188                } 
     189 
    178190                /** 
    179191                 * @return true if free search is supported by one of the children