Class IDMapperText

  • All Implemented Interfaces:
    IDMapper

    public class IDMapperText
    extends IDMapperFile
    Class for mapping ID from delimited text file.
    Author:
    gjj
    • Constructor Detail

      • IDMapperText

        public IDMapperText​(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​(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​(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 Set<Xref> freeSearch​(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 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