Revision 423M

org.bridgedb.file
Class IDMapperText

java.lang.Object
  extended by org.bridgedb.file.IDMapperFile
      extended by org.bridgedb.file.IDMapperText
All Implemented Interfaces:
IDMapper

public class IDMapperText
extends IDMapperFile

Class for mapping ID from delimited text file.

Author:
gjj

Field Summary
 
Fields inherited from class org.bridgedb.file.IDMapperFile
cap, reader
 
Constructor Summary
IDMapperText(java.net.URL url)
          Constructor from the URL of a tab-delimited text file.
IDMapperText(java.net.URL url, char[] dataSourceDelimiters)
          Transitivity is unsupported.
IDMapperText(java.net.URL url, char[] dataSourceDelimiters, char[] idDelimiters)
          Transitivity is unsupported.
IDMapperText(java.net.URL url, char[] dataSourceDelimiters, char[] idDelimiters, boolean transitivity)
          Constructor from the URL of a tab-delimited text file, delimiters to separate between different data sources and IDs and transitivity support.
 
Method Summary
 java.util.Set<Xref> freeSearch(java.lang.String text, int limit)
          Free search is not supported for delimiter-text file.
 char[] getDataSourceDelimiters()
           
 char[] getIDDelimiters()
           
 boolean getTransitivity()
          Get transitivity support.
 java.net.URL getURL()
          Get URL of the file.
 void setDataSourceDelimiters(char[] dataSourceDelimiters)
          Set delimiters between data sources.
 void setIDDelimiters(char[] idDelimiters)
          Set delimiters between data IDs.
 void setTransitivity(boolean transitivity)
          Set transitivity support.
 
Methods inherited from class org.bridgedb.file.IDMapperFile
close, getCapabilities, getIDMappingReader, isConnected, mapID, mapID, xrefExists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IDMapperText

public IDMapperText(java.net.URL url)
             throws IDMapperException
Constructor from the URL of a tab-delimited text file.

Parameters:
url - URL of the file
Throws:
IDMapperException - if failed to read file

IDMapperText

public IDMapperText(java.net.URL url,
                    char[] dataSourceDelimiters)
             throws IDMapperException
Transitivity is unsupported. No delimiter between data sources.

Parameters:
url - url URL of the file
dataSourceDelimiters - delimiters between data sources
Throws:
IDMapperException - if failed to read file

IDMapperText

public IDMapperText(java.net.URL url,
                    char[] dataSourceDelimiters,
                    char[] idDelimiters)
             throws IDMapperException
Transitivity is unsupported.

Parameters:
url - url URL of the file
dataSourceDelimiters - delimiters between data sources
idDelimiters - delimiters between IDs
Throws:
IDMapperException - if failed to read file

IDMapperText

public IDMapperText(java.net.URL url,
                    char[] dataSourceDelimiters,
                    char[] idDelimiters,
                    boolean transitivity)
             throws IDMapperException
Constructor from the URL of a tab-delimited text file, delimiters to separate between different data sources and IDs and transitivity support.

Parameters:
url - url URL of the file
dataSourceDelimiters - delimiters between data sources
idDelimiters - delimiters between IDs
transitivity - support transitivity if true
Throws:
IDMapperException - if failed to read file
Method Detail

freeSearch

public java.util.Set<Xref> freeSearch(java.lang.String text,
                                      int limit)
                               throws IDMapperException
Free search is not supported for delimiter-text file. This will throw UnsupportedOperationException

Parameters:
text - ignored
limit - ignored
Returns:
does not return
Throws:
IDMapperException - will not be thrown

setTransitivity

public void setTransitivity(boolean transitivity)
Set transitivity support.

Parameters:
transitivity - support transitivity if true.

getTransitivity

public boolean getTransitivity()
Get transitivity support.

Returns:
true if support transitivity; false otherwise.

getURL

public java.net.URL getURL()
Get URL of the file.

Returns:
URL of the file

getDataSourceDelimiters

public char[] getDataSourceDelimiters()
Returns:
delimiters between data sources

getIDDelimiters

public char[] getIDDelimiters()
Returns:
delimiters between data IDs

setDataSourceDelimiters

public void setDataSourceDelimiters(char[] dataSourceDelimiters)
Set delimiters between data sources.

Parameters:
dataSourceDelimiters - delimiters between data sources

setIDDelimiters

public void setIDDelimiters(char[] idDelimiters)
Set delimiters between data IDs.

Parameters:
idDelimiters - delimiters between data IDs

Generated July 29 2010