xbneditor
Class FileIO
java.lang.Object
|
+--xbneditor.FileIO
- public class FileIO
- extends java.lang.Object
This class is responsible for the reading and writing of the Bayesian
Networks to disk. It reads them in in the BNIF 0.13 format and then
will put them in the corresponding data structure so that the network
can be manipulated.
Fix the bug for bif file format , and extend it to Genie(.dsl) and Hugin(.net) format on Friday, Nov. 02, 2001
Now it can load .xml, .bif, .dsl and .net file format; it can save to .xml and .bif format
Updated on Wednesday, Nov. 07, 2001 --> now it can load 6 BBN formats: .bif, .xml, .xbn, .dsc, .dsl, .net
Updated on Thursday, Nov. 08, 2001 --> now it can load 2 more BBN formats: .dnet, .ent
|
Constructor Summary |
FileIO()
The constructor for the Bayesian Network class. |
|
Method Summary |
void |
convert(java.lang.String outputfilename,
java.util.LinkedList baynet,
java.lang.String outputfiletype)
This function takes in a Bayesian Network that has already been
created and will then save it to disk. |
java.lang.String |
getFileType()
Returns the current type of file that is being used to save
the Bayesian network status |
java.util.LinkedList |
load(java.lang.String filename)
This function loads a specific file into the editor. |
void |
save(java.lang.String filename,
java.util.LinkedList baynet)
This function takes in a Bayesian Network that has already been
created and will then save it to disk. |
void |
setFileType(java.lang.String type)
Sets the current type of file that is being used. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileIO
public FileIO()
- The constructor for the Bayesian Network class. It will provide
the functionality to load a Bayesian Network from disk or to
save a newly created or modified Bayesian Network.
save
public void save(java.lang.String filename,
java.util.LinkedList baynet)
- This function takes in a Bayesian Network that has already been
created and will then save it to disk. It will save it to the file
format that the user has specified.
- Parameters:
filename - the file that this network is being saved tobaynet - the Bayesian Network that needs to be saved
convert
public void convert(java.lang.String outputfilename,
java.util.LinkedList baynet,
java.lang.String outputfiletype)
- This function takes in a Bayesian Network that has already been
created and will then save it to disk. It will save it to the file
format that the user has specified.
- Parameters:
filename - the file that this network is being saved tobaynet - the Bayesian Network that needs to be saved
load
public java.util.LinkedList load(java.lang.String filename)
- This function loads a specific file into the editor. It determines
what file type has been picked and then it will direct it to the
appropriate functions that need to be called.
- Parameters:
filename - the name of the file that contains the Bayesian
Network that needs to be loaded- Returns:
- baynet the Bayesian Network that was read in from the file
setFileType
public void setFileType(java.lang.String type)
- Sets the current type of file that is being used. This is useful
when a file is being imported to the editor.
- Parameters:
type - the type of the file
getFileType
public java.lang.String getFileType()
- Returns the current type of file that is being used to save
the Bayesian network status
- Returns:
- currenttype - the current type of the file