Package it.univr.di.cstnu.util
Class GraphML2Luke
java.lang.Object
it.univr.di.cstnu.util.GraphML2Luke
Utility class for converting STNU file in GraphML format to Luke format.
- Version:
- $Rev: 732 $
- Author:
- posenato
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FileConverts the given GraphML STNU file to Luke's plain STNU format, using the default output name.static voidConverts the given GraphML STNU file to Luke's plain STNU format.static void(package private) static voidstnuPlainWriter(TNGraph<STNUEdge> graph, File outputFile) Saves the given stnu in file filename in the Hunsberger format.
Hunsberger format example:
-
Field Details
-
LOG
class logger -
plainSuffix
Default extension- See Also:
-
VERSIONandDATE
Version- See Also:
-
-
Constructor Details
-
GraphML2Luke
public GraphML2Luke()
-
-
Method Details
-
main
- Parameters:
args- a CSTN file in Luke's format.- Throws:
IOException- if any file cannot be read or written
-
convert
public static File convert(File inputFile) throws IOException, ParserConfigurationException, SAXException Converts the given GraphML STNU file to Luke's plain STNU format, using the default output name.- Parameters:
inputFile- the GraphML STNU file to convert- Returns:
- the generated plain STNU file
- Throws:
IOException- if the input or output file cannot be read or writtenParserConfigurationException- if the XML parser cannot be configuredSAXException- if the input file does not contain valid GraphML
-
convert
public static void convert(File inputFile, File outputFile) throws IOException, ParserConfigurationException, SAXException Converts the given GraphML STNU file to Luke's plain STNU format.- Parameters:
inputFile- the GraphML STNU file to convertoutputFile- the output plain STNU file- Throws:
IOException- if the input or output file cannot be read or writtenParserConfigurationException- if the XML parser cannot be configuredSAXException- if the input file does not contain valid GraphML
-
stnuPlainWriter
Saves the given stnu in file filename in the Hunsberger format.
Hunsberger format example:# KIND OF NETWORK STNU # Num Time-Points 5 # Num Ordinary Edges 4 # Num Contingent Links 2 # Time-Point Names A0 C0 A1 C1 X # Ordinary Edges X 12 C0 C1 11 C0 C0 -7 X C0 -1 C1 # Contingent Links A0 1 3 C0 A1 1 10 C1 ...
- Parameters:
graph- the input graphoutputFile- the output file
-