Modifier and Type | Method and Description |
---|---|
static ContextSerializerBurmeister |
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 .cxt files.
|
void |
write(Context context,
BufferedWriter file)
Write a context to a file.
|
public static ContextSerializerBurmeister getInstance()
Return the singleton instance of this class.
public static void register()
Register this class for reading and writing .cxt files.
public void read(Context context, BufferedReader file) throws IOException
Read a context from a file.
The Burmeister cxt format file is respected :
The file format is structured as follows:
The first line consists of a single “B” The second line contains the name of the context (note that this is ignored) The third and fourth line consist of the object and attribute count, respectively after that, all objects and all attributes are listed, each on a separate line finally, the context is given as a combination of . and X, each row on a separate line.
B
Example
2
2
a
b
1
2
.X
XX
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 Burmeister cxt format file is respected :
The file format is structured as follows:
The first line consists of a single “B” The second line contains the name of the context (note that this is ignored) The third and fourth line consist of the object and attribute count, respectively. The fifth line is empty. After that, all objects and all attributes are listed, each on a separate line finally, the context is given as a combination of . and X, each row on a separate line.
B
Example
2
2
a
b
1
2
.X
XX
write
in interface Writer<Context>
context
- a context to writefile
- a fileIOException
- When an IOException occursCopyright © 2010–2016 The Galactic Organization. All rights reserved.