public class TextFileDataset extends MapBackedDataset<String,ListDataset<FImage>,FImage>
personA,/path/to/image.jpg personA,/path/to/image1.jpg personB,/path/to/image2.jpg ...The default separator is a comma, but is user controllable.
In addition to allowing datasets to be read from a file, this
implementation also allows datasets to be created or appended
to through the add(String, File)
method.
MapBackedDataset.IdentifiableBuilder<DATASET extends Dataset<INSTANCE> & Identifiable,INSTANCE>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
map
Constructor and Description |
---|
TextFileDataset(File file)
Construct from the given file.
|
TextFileDataset(File file,
String separator)
Construct from the given file, using the given separator.
|
Modifier and Type | Method and Description |
---|---|
void |
add(String person,
File file)
Add an instance to the dataset.
|
protected void |
finalize() |
String |
toString() |
add, builder, entrySet, getGroups, getInstances, getMap, getRandomInstance, getRandomInstance, iterator, numInstances, of, of, of, of, of, of, of, put
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, values
public TextFileDataset(File file) throws IOException
file
- the fileIOException
- if an error occurspublic TextFileDataset(File file, String separator) throws IOException
file
- the fileseparator
- the separatorIOException
- if an error occurspublic void add(String person, File file) throws IOException
person
- file
- IOException
public String toString()
toString
in class MapBackedDataset<String,ListDataset<FImage>,FImage>