Revision 423M

org.bridgedb
Class DataSourcePatterns

java.lang.Object
  extended by org.bridgedb.DataSourcePatterns

public final class DataSourcePatterns
extends java.lang.Object

Contains regular expression patterns for identifiers Can be used to guess the BioDataSource of an identifier of unknown origin.


Method Summary
static java.util.Set<DataSource> getDataSourceMatches(java.lang.String id)
          Look for all DataSource patterns that match a given input.
static java.util.Map<DataSource,java.util.regex.Pattern> getPatterns()
           
static void registerPattern(DataSource key, java.util.regex.Pattern value)
          Register a regex Pattern for recognizing a DataSource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

registerPattern

public static void registerPattern(DataSource key,
                                   java.util.regex.Pattern value)
Register a regex Pattern for recognizing a DataSource.

Parameters:
key - the DataSource that may be recognized.
value - the Pattern to look for.

getDataSourceMatches

public static java.util.Set<DataSource> getDataSourceMatches(java.lang.String id)
Look for all DataSource patterns that match a given input.

Parameters:
id - to compare with registered patterns
Returns:
set of patterns which matches the given id.

getPatterns

public static java.util.Map<DataSource,java.util.regex.Pattern> getPatterns()
Returns:
all known data patterns, mapped to their BioDataSource. For example, this map will contain:
    BioDataSource.ENSEMBL_HUMAN -> Pattern.compile("ENSG\d+")
 

There is not guaranteed to be a Pattern for every BioDataSource constant.


Generated July 29 2010