Class FileLabelMap<T>
Object
FileLabelMap<T>
- Type Parameters:
T- the type of the file identifier
A map that associates file identifiers with labels, typically loaded from a CSV file.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new file identifier and label pair to the map.entrySet()Gets the entry set of the internal map.Gets the label associated with a file identifier.labels()Gets a set of all unique labels in the map.static FileLabelMap<String> readFromCSV(Path csvPath, boolean quotedStrings) Reads aFileLabelMapfrom a CSV file.
-
Method Details
-
readFromCSV
public static FileLabelMap<String> readFromCSV(Path csvPath, boolean quotedStrings) throws CSVReaderException Reads aFileLabelMapfrom a CSV file.- Parameters:
csvPath- thePathto the CSV filequotedStrings- whether strings in the CSV are quoted- Returns:
- a new
FileLabelMapinstance populated with data from the CSV - Throws:
CSVReaderException- if there's an error reading the CSV file
-
add
-
get
-
labels
-
entrySet
-