Class IOoperations
java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.external.services.io.IOoperations
Providing basic input/output operations.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Returns the elements of a HashSet in one line without a line break.static boolean
Checks whether half of the word consists of numbers.static void
printFirstLinesOfFile
(String filePath, int numberOfLines) Outputs the first view lines of a file to the console.static void
printFirstLinesOfGzippedFile
(String filePath, int numberOfLines) Outputs the first view lines of a gzipped file to the console .static <K,
V> void printHashMap
(HashMap<K, V> hashMapToPrint) Prints the content of a HashMapstatic <T> void
printOverlapOfSet
(Iterable<T> s1, Iterable<T> s2) Prints overlapping parts of two string arrays..readTabSeparatedFile
(File file) Reads a tab separated file.static void
writeContentToFile
(File file, String content) A very simple file writer.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.static void
writeSetToFileInOutputDirectory
(Set set, String fileName) Writes the given set to a file in./output/<filename>
.
-
Field Details
-
LOG
private static org.slf4j.Logger LOG
-
-
Constructor Details
-
IOoperations
public IOoperations()
-
-
Method Details
-
printOverlapOfSet
Prints overlapping parts of two string arrays..- Type Parameters:
T
- The type.- Parameters:
s1
- Array 1.s2
- Array 2.
-
printHashMap
Prints the content of a HashMap- Type Parameters:
K
- Key Type.V
- Value Type.- Parameters:
hashMapToPrint
- HashMap which shall be printed.
-
convertSetToStringPipeSeparated
Returns the elements of a HashSet in one line without a line break.- Parameters:
set
- Set to be converted.- Returns:
- Result String.
-
readTabSeparatedFile
Reads a tab separated file.- Parameters:
file
- File to read.- Returns:
- ArrayList with String[].
-
writeSetToFileInOutputDirectory
Writes the given set to a file in./output/<filename>
.- Parameters:
set
- Set to write.fileName
- Filename (not path).
-
writeContentToFile
A very simple file writer.- Parameters:
file
- The file in which shall be written.content
- The content that shall be written.
-
writeContentToFile
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
Checks whether half of the word consists of numbers.- Parameters:
word
- word to be checked- Returns:
- true if numeric, else false
-
printFirstLinesOfGzippedFile
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
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.
-