java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.external.services.io.IOoperations

public class IOoperations extends Object
Providing basic input/output operations.
  • Field Details

    • LOG

      private static org.slf4j.Logger LOG
  • Constructor Details

    • IOoperations

      public IOoperations()
  • Method Details

    • printOverlapOfSet

      public static <T> void printOverlapOfSet(Iterable<T> s1, Iterable<T> s2)
      Prints overlapping parts of two string arrays..
      Type Parameters:
      T - The type.
      Parameters:
      s1 - Array 1.
      s2 - Array 2.
    • printHashMap

      public static <K, V> void printHashMap(HashMap<K,V> hashMapToPrint)
      Prints the content of a HashMap
      Type Parameters:
      K - Key Type.
      V - Value Type.
      Parameters:
      hashMapToPrint - HashMap which shall be printed.
    • convertSetToStringPipeSeparated

      public static String convertSetToStringPipeSeparated(Set<String> set)
      Returns the elements of a HashSet in one line without a line break.
      Parameters:
      set - Set to be converted.
      Returns:
      Result String.
    • readTabSeparatedFile

      public static ArrayList<String[]> readTabSeparatedFile(File file)
      Reads a tab separated file.
      Parameters:
      file - File to read.
      Returns:
      ArrayList with String[].
    • writeSetToFileInOutputDirectory

      public static void writeSetToFileInOutputDirectory(Set set, String fileName)
      Writes the given set to a file in ./output/<filename>.
      Parameters:
      set - Set to write.
      fileName - Filename (not path).
    • writeContentToFile

      public static void writeContentToFile(File file, String content)
      A very simple file writer.
      Parameters:
      file - The file in which shall be written.
      content - The content that shall be written.
    • writeContentToFile

      public static void writeContentToFile(String fileNameWithinOutputDirectory, String content)
      A simple file writer which writes a file with the specified file name and the specified content into the output directory.
      Parameters:
      fileNameWithinOutputDirectory - Name of the file within the output directory.
      content - Output to write.
    • isNumeric

      public static boolean isNumeric(String word)
      Checks whether half of the word consists of numbers.
      Parameters:
      word - word to be checked
      Returns:
      true if numeric, else false
    • printFirstLinesOfGzippedFile

      public static void printFirstLinesOfGzippedFile(String filePath, int numberOfLines)
      Outputs the first view lines of a gzipped file to the console .
      Parameters:
      filePath - Path to the file.
      numberOfLines - Number of lines to be printed.
    • printFirstLinesOfFile

      public static void printFirstLinesOfFile(String filePath, int numberOfLines)
      Outputs the first view lines of a file to the console. This can be useful when a very large file cannot be opened in a text editor.
      Parameters:
      filePath - Path to file.
      numberOfLines - Number of lines to be printed.