|
Revision 423M | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.bridgedb.IDMapperStack
public class IDMapperStack
combines multiple IDMapper's in a stack.
The behavior of the IDMapper interface implementations
differs per method:
if the method returns a single result, usually it is
from the first child database that has a sensible result.
This also means that the child databases have a definitive
ordering: the first one shadows the second one for some results.
If the method returns a list, IDMapperStack joins the result from all connected child databases together.
| Field Summary |
|---|
| Fields inherited from interface org.bridgedb.AttributeMapper |
|---|
MATCH_ID |
| Constructor Summary | |
|---|---|
IDMapperStack()
|
|
| Method Summary | |
|---|---|
void |
addIDMapper(IDMapper idMapper)
Add an existing IDMapper to the stack. |
IDMapper |
addIDMapper(java.lang.String connectionString)
Create a fresh IDMapper from a connectionString and add it to the stack. |
void |
close()
closes all child databases. |
java.util.Map<Xref,java.lang.String> |
freeAttributeSearch(java.lang.String query,
java.lang.String attrType,
int limit)
free text search for matching symbols. |
java.util.Set<Xref> |
freeSearch(java.lang.String text,
int limit)
free text search for matching symbols or identifiers. |
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
getAttributes(Xref ref)
Get all attributes for an entity. |
java.util.Set<java.lang.String> |
getAttributes(Xref ref,
java.lang.String attrname)
Get attributes for an entity, such as gene Symbol. |
java.util.Set<java.lang.String> |
getAttributeSet()
Set of attributes provided by this AttributeMapper. |
IDMapperCapabilities |
getCapabilities()
|
IDMapper |
getIDMapperAt(int index)
|
int |
getSize()
|
boolean |
getTransitive()
|
boolean |
isConnected()
Use this method to check if the IDMapper is still valid. |
boolean |
isFreeAttributeSearchSupported()
|
java.util.Map<Xref,java.util.Set<Xref>> |
mapID(java.util.Collection<Xref> srcXrefs,
DataSource... tgtDataSources)
Get all cross-references for a set of entities, restricting the result to contain only references from the given set of data sources. |
java.util.Set<Xref> |
mapID(Xref ref,
DataSource... resultDs)
Get all cross-references for the given entity, restricting the result to contain only references from the given set of data sources. |
void |
removeIDMapper(IDMapper idMapper)
Remove an idMapper from the stack. |
void |
setTransitive(boolean value)
Set Transitivity mode, where all mappings are combined to infer second degree mappings. |
java.lang.String |
toString()
|
boolean |
xrefExists(Xref xref)
Check whether an Xref is known by the given mapping source. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IDMapperStack()
| Method Detail |
|---|
public IDMapper addIDMapper(java.lang.String connectionString)
throws IDMapperException
connectionString - connectionString for configuring the new IDMapper
IDMapperException - when the connection failed.public void addIDMapper(IDMapper idMapper)
idMapper - IDMapper to be added.public void setTransitive(boolean value)
value - true or falsepublic boolean getTransitive()
public void removeIDMapper(IDMapper idMapper)
idMapper - IDMapper to be removed.
public void close()
throws IDMapperException
close in interface IDMapperIDMapperException - when closing failed for one of the databases. It will still try to
close all child databases even if one throws an exception. However, only the last exception will be thrown.
public boolean xrefExists(Xref xref)
throws IDMapperException
xrefExists in interface IDMapperxref - reference to check
IDMapperException - if failed, UnsupportedOperationException if it's not supported by the Driver.public boolean isConnected()
IDMapper
isConnected in interface IDMapperpublic IDMapperCapabilities getCapabilities()
getCapabilities in interface IDMapper
public java.util.Set<Xref> freeSearch(java.lang.String text,
int limit)
throws IDMapperException
freeSearch in interface IDMappertext - text to searchlimit - up limit of number of hits
IDMapperException - if failed
public java.util.Map<Xref,java.util.Set<Xref>> mapID(java.util.Collection<Xref> srcXrefs,
DataSource... tgtDataSources)
throws IDMapperException
mapID in interface IDMappersrcXrefs - source Xref, containing ID and ID type/data sourcetgtDataSources - target ID types/data sources. Set this to null
if you want to retrieve all results.
IDMapperException - if the mapping service is (temporarily) unavailable
public java.util.Set<java.lang.String> getAttributes(Xref ref,
java.lang.String attrname)
throws IDMapperException
getAttributes in interface AttributeMapperref - the entity to get the attribute forattrname - the attribute to look for, e.g. 'Symbol' or 'Description'.
IDMapperException - if the mapping service is (temporarily) unavailablepublic boolean isFreeAttributeSearchSupported()
isFreeAttributeSearchSupported in interface AttributeMapper
public java.util.Map<Xref,java.lang.String> freeAttributeSearch(java.lang.String query,
java.lang.String attrType,
int limit)
throws IDMapperException
freeAttributeSearch in interface AttributeMapperquery - The text to search forattrType - the attribute to look for, e.g. 'Symbol' or 'Description'.
If you use the special MATCH_ID constant, it will query the identifier instead.limit - The number of results to limit the search to
IDMapperException - if the mapping service is (temporarily) unavailablepublic java.lang.String toString()
toString in class java.lang.Objectpublic int getSize()
public IDMapper getIDMapperAt(int index)
index - in the range 0 <= index < getSize()
public java.util.Set<Xref> mapID(Xref ref,
DataSource... resultDs)
throws IDMapperException
mapID in interface IDMapperref - the entity to get cross-references for.resultDs - target ID types/data sources. Set this to null if you
want to retrieve all results.
IDMapperException - if the mapping service is (temporarily) unavailable
public java.util.Set<java.lang.String> getAttributeSet()
throws IDMapperException
getAttributeSet in interface AttributeMapperIDMapperException - if the mapping service is (temporarily) unavailable
public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getAttributes(Xref ref)
throws IDMapperException
getAttributes in interface AttributeMapperref - the entity to get the attributes for
IDMapperException - if the mapping service is (temporarily) unavailable
|
Generated July 29 2010 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||