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

Add isFreeAttributeSearchSupported() to AttributeMapper?

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • 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 =