|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.gui.graphvisualizer.BIFParser
This class parses an inputstream or a string in XMLBIF ver. 0.3 format, and builds the datastructures that are passed to it through the constructor.
Field Summary | |
protected java.lang.String |
graphName
This holds the name of the graph (i.e. the name of network tag in XMLBIF input) |
protected java.io.InputStream |
inStream
This holds the InputStream to be parsed |
protected java.lang.String |
inString
This holds the string to be parsed |
protected FastVector |
m_edges
These holds the nodes and edges of the graph |
protected FastVector |
m_nodes
These holds the nodes and edges of the graph |
Fields inherited from interface weka.gui.graphvisualizer.GraphConstants |
DIRECTED, DOUBLE, NORMAL, PLURAL_DUMMY, REVERSED, SINGULAR_DUMMY |
Constructor Summary | |
BIFParser(java.io.InputStream instream,
FastVector nodes,
FastVector edges)
Constructor (if our input is an InputStream) |
|
BIFParser(java.lang.String input,
FastVector nodes,
FastVector edges)
Constructor (if our input is a String) |
Method Summary | |
java.lang.String |
parse()
This method parses the string or the InputStream that we passed in through the constructor and builds up the m_nodes and m_edges vectors |
static void |
writeXMLBIF03(java.lang.String filename,
java.lang.String graphName,
FastVector nodes,
FastVector edges)
This method writes a graph in XMLBIF ver. 0.3 format to a file. |
private static java.lang.String |
XMLNormalize(java.lang.String sStr)
XMLNormalize converts the five standard XML entities in a string g.e. the string V&D's is returned as V&D's |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected FastVector m_nodes
protected FastVector m_edges
protected java.lang.String graphName
protected java.lang.String inString
protected java.io.InputStream inStream
Constructor Detail |
public BIFParser(java.lang.String input, FastVector nodes, FastVector edges)
input
- the string to be parsed (should not be null)nodes
- vector containing GraphNode objects (should be empty)edges
- vector containing GraphEdge objects (should be empty)public BIFParser(java.io.InputStream instream, FastVector nodes, FastVector edges)
instream
- the InputStream to be parsed (should not be null)nodes
- vector containing GraphNode objects (should be empty)edges
- vector containing GraphEdge objects (should be empty)Method Detail |
public java.lang.String parse() throws BIFFormatException, java.lang.NumberFormatException, java.lang.Exception
-
- Exception if both the inString and inStream are
null, i.e. no input has been provided
-
- BIFFormatException if there is format of the
input is not correct. The format should conform to
XMLBIF version 0.3
-
- NumberFormatException if there is an invalid
char in the probability table of a node.
BIFFormatException
java.lang.NumberFormatException
java.lang.Exception
public static void writeXMLBIF03(java.lang.String filename, java.lang.String graphName, FastVector nodes, FastVector edges)
filename
- - The name of the file to write in. (will overwrite)graphName
- - The name of the graph. (will be the name of network
tag in XMLBIF)nodes
- - Vector containing all the nodesedges
- - Vector containing all the edgesprivate static java.lang.String XMLNormalize(java.lang.String sStr)
sStr
- string to normalize
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |