Class IDReplacer


  • public class IDReplacer
    extends java.lang.Object
    This class takes as input a database or table-shaped file, a database source ID column index, an ID mapping file and an source ID mapping file column index. The indexes are zero-based. The program will replace the source IDs in the database column with the target IDs that they are mapped to in the mapping file. The mapping file is allowed to contain n-to-m-mappings. In such cases, each database record line will be output for each ID mapping target. All files must use the tab character as the column separator.
    Author:
    faessler
    • Constructor Summary

      Constructors 
      Constructor Description
      IDReplacer​(java.io.File dbFile, int dbIndex, java.io.File mappingFile, int mappingIndex)  
      IDReplacer​(java.io.File dbFile, int dbIndex, java.io.File mappingFile, int mappingIndex, java.io.File output)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getMapping()  
      static void main​(java.lang.String[] args)  
      void readMapping()  
      void replace()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IDReplacer

        public IDReplacer​(java.io.File dbFile,
                          int dbIndex,
                          java.io.File mappingFile,
                          int mappingIndex)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • IDReplacer

        public IDReplacer​(java.io.File dbFile,
                          int dbIndex,
                          java.io.File mappingFile,
                          int mappingIndex,
                          java.io.File output)
                   throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getMapping

        public java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getMapping()
      • readMapping

        public void readMapping()
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • replace

        public void replace()
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException
        Throws:
        java.io.IOException