Modifier and Type | Method and Description |
---|---|
static ContextSerializerFIMI |
getInstance()
Return the singleton instance of this class.
|
void |
read(Context context,
BufferedReader file)
Read a context from a file.
|
static void |
register()
Register this class for reading and writing .dat files.
|
void |
write(Context context,
BufferedWriter file)
Write a context to a file.
|
public static ContextSerializerFIMI getInstance()
Return the singleton instance of this class.
public static void register()
Register this class for reading and writing .dat files.
public void read(Context context, BufferedReader file) throws IOException
Read a context from a file.
The FIMI dat format file is respected:
The file format is structured as follows:
Each line corresponds to an observation Each line is made of a list of integers corresponding to attributes separated by a space
1 3
2 4 5
1 2
3 4 5
For reading convinience, observations are labelled with ‘O’ + LineNumber.
Be careful when using a downloaded file: an empty line at the end of the file gives an observation with no attributes
read
in interface Reader<Context>
context
- a context to readfile
- a fileIOException
- When an IOException occurspublic void write(Context context, BufferedWriter file) throws IOException
Write a context to a file.
The FIMI dat format file is respected :
The file format is structured as follows:
Each line corresponds to an observation Each line is made of a list of integers corresponding to attributes separated by a space
1 3
2 4 5
1 2
3 4 5
write
in interface Writer<Context>
context
- a context to writefile
- a fileIOException
- When an IOException occursCopyright © 2010–2016 The Galactic Organization. All rights reserved.