Changeset 307 for trunk

Show
Ignore:
Timestamp:
02/19/10 06:56:50 (2 years ago)
Author:
jgao
Message:

Add isFreeAttributeSearchSupported() to AttributeMapper?

Location:
trunk
Files:
7 modified

Legend:

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

    r283 r307  
    4444        public Map<String, Set<String>> getAttributes(Xref ref) throws IDMapperException; 
    4545 
     46        /** 
     47         * 
     48         * @return true if free attribute search is supported, false otherwise. 
     49         */ 
     50        public boolean isFreeAttributeSearchSupported(); 
     51 
    4652        /** 
    4753         * free text search for matching symbols. 
  • trunk/corelib/src/org/bridgedb/IDMapperStack.java

    r291 r307  
    341341        } 
    342342 
     343        /** 
     344         * @return true if free attribute search is supported by one of the children 
     345         */ 
     346        public boolean isFreeAttributeSearchSupported() 
     347        { 
     348                // returns true if any returns true 
     349                // TODO: not sure if this is the right logic? 
     350                for (IDMapper child : IDMapperStack.this.gdbs) 
     351                { 
     352                        if (child != null && child instanceof AttributeMapper) 
     353                        { 
     354                                if (((AttributeMapper)child).isFreeAttributeSearchSupported()) 
     355                                        return true; 
     356                        } 
     357                } 
     358                return false; 
     359        } 
     360 
    343361        /** {@inheritDoc} */ 
    344362        public Map<Xref, String> freeAttributeSearch (String query, String attrType, int limit) throws IDMapperException 
     
    347365                for (IDMapper child : gdbs) 
    348366                { 
    349                         if (child != null && child instanceof AttributeMapper && child.isConnected()) 
     367                        if (child != null && child instanceof AttributeMapper && child.isConnected() 
     368                                && ((AttributeMapper)child).isFreeAttributeSearchSupported()) 
    350369                        { 
    351370                                Map<Xref, String> childResult =  
  • trunk/corelib/src/org/bridgedb/rdb/SimpleGdbImpl2.java

    r289 r307  
    661661 
    662662        /** 
     663         * 
     664         * @return true 
     665         */ 
     666        public boolean isFreeAttributeSearchSupported() 
     667        { 
     668                return true; 
     669        } 
     670 
     671        /** 
    663672         * free text search for matching symbols. 
    664673         * @return references that match the query 
  • trunk/corelib/src/org/bridgedb/rdb/SimpleGdbImpl3.java

    r288 r307  
    581581                } catch (SQLException e) { throw new IDMapperException ("Xref:" + ref, e); } // Database unavailable 
    582582        } 
     583 
     584        /** 
     585         * 
     586         * @return true 
     587         */ 
     588        public boolean isFreeAttributeSearchSupported() 
     589        { 
     590                return true; 
     591        } 
    583592         
    584593        /** 
  • trunk/corelib/src/org/bridgedb/webservice/biomart/IDMapperBiomart.java

    r297 r307  
    370370 
    371371    /** 
     372     * 
     373     * @return false 
     374     */ 
     375    public boolean isFreeAttributeSearchSupported() 
     376    { 
     377        return false; 
     378    } 
     379 
     380    /** 
    372381     * {@inheritDoc} 
    373382     */ 
  • trunk/corelib/src/org/bridgedb/webservice/bridgerest/BridgeRest.java

    r298 r307  
    409409        } 
    410410 
     411        /** 
     412         * 
     413         * @return true 
     414         */ 
     415        public boolean isFreeAttributeSearchSupported() 
     416        { 
     417                return true; 
     418        } 
     419 
    411420        /** {@inheritDoc} */ 
    412421        public Map<Xref, String> freeAttributeSearch(String query, String attrType, 
  • trunk/picr/src/org/bridgedb/webservice/picr/IDMapperPicr.java

    r252 r307  
    202202        } 
    203203 
     204        /** 
     205         * 
     206         * @return false 
     207         */ 
     208        public boolean isFreeAttributeSearchSupported() 
     209        { 
     210                return false; 
     211        } 
     212 
    204213        public Map<Xref, String> freeAttributeSearch(String query, String attrType, 
    205214                        int limit) throws IDMapperException