Package org.bridgedb.file
Class IDMapperText
- java.lang.Object
-
- org.bridgedb.file.IDMapperFile
-
- 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
Constructors Constructor Description IDMapperText(URL url)Constructor from theURLof a tab-delimited text file.IDMapperText(URL url, char[] dataSourceDelimiters)Transitivity is unsupported.IDMapperText(URL url, char[] dataSourceDelimiters, char[] idDelimiters)Transitivity is unsupported.IDMapperText(URL url, char[] dataSourceDelimiters, char[] idDelimiters, boolean transitivity)Constructor from theURLof a tab-delimited text file, delimiters to separate between different data sources and IDs and transitivity support.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Xref>freeSearch(String text, int limit)Free search is not supported for delimiter-text file.char[]getDataSourceDelimiters()char[]getIDDelimiters()booleangetTransitivity()Get transitivity support.URLgetURL()GetURLof the file.voidsetDataSourceDelimiters(char[] dataSourceDelimiters)Set delimiters between data sources.voidsetIDDelimiters(char[] idDelimiters)Set delimiters between data IDs.voidsetTransitivity(boolean transitivity)Set transitivity support.StringtoString()-
Methods inherited from class org.bridgedb.file.IDMapperFile
close, getCapabilities, getIDMappingReader, isConnected, mapID, mapID, xrefExists
-
-
-
-
Constructor Detail
-
IDMapperText
public IDMapperText(URL url) throws IDMapperException
Constructor from theURLof a tab-delimited text file.- Parameters:
url-URLof the file- Throws:
IDMapperException- if failed to read file
-
IDMapperText
public IDMapperText(URL url, char[] dataSourceDelimiters) throws IDMapperException
Transitivity is unsupported. No delimiter between data sources.- Parameters:
url- urlURLof the filedataSourceDelimiters- delimiters between data sources- Throws:
IDMapperException- if failed to read file
-
IDMapperText
public IDMapperText(URL url, char[] dataSourceDelimiters, char[] idDelimiters) throws IDMapperException
Transitivity is unsupported.- Parameters:
url- urlURLof the filedataSourceDelimiters- delimiters between data sourcesidDelimiters- delimiters between IDs- Throws:
IDMapperException- if failed to read file
-
IDMapperText
public IDMapperText(URL url, char[] dataSourceDelimiters, char[] idDelimiters, boolean transitivity) throws IDMapperException
Constructor from theURLof a tab-delimited text file, delimiters to separate between different data sources and IDs and transitivity support.- Parameters:
url- urlURLof the filedataSourceDelimiters- delimiters between data sourcesidDelimiters- delimiters between IDstransitivity- support transitivity if true- Throws:
IDMapperException- if failed to read file
-
-
Method Detail
-
freeSearch
public Set<Xref> freeSearch(String text, int limit) throws IDMapperException
Free search is not supported for delimiter-text file. This will throw UnsupportedOperationException- Parameters:
text- ignoredlimit- 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.
-
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
-
-