Class TCGraphMLWriter
java.lang.Object
it.univr.di.cstnu.graph.TCGraphMLWriter
Writes a temporal-constraint graph in GraphML without depending on JUNG.
Coordinates are taken from LabeledNode.getX() and LabeledNode.getY(). This
is the persistent coordinate model already used by the static layout; callers using an editor
layout must copy its current coordinates into the nodes before saving.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringGraphML key for an edge case value.static final StringGraphML key for lower-case labeled values on an edge.static final StringGraphML key for upper-case labeled values on an edge.static final StringGraphML key for labeled values on an edge.static final StringGraphML key for the explicit routing of an edge.static final StringGraphML key for the type of edge.static final StringGraphML key for the numeric value of an edge.static final StringGraphML key for presentation-only plain-text annotations.static final StringGraphML key for a persisted check outcome.static final StringGraphML key for a persisted dispatchability representation.static final StringGraphML key for the graph name.static final StringGraphML key for the number of contingent nodes in the graph.static final StringGraphML key for the number of edges in the graph.static final StringGraphML key for the number of observed propositions in the graph.static final StringGraphML key for the number of vertices in the graph.static final StringGraphML key for the fingerprint protecting persisted outcomes.static final StringGraphML key for the network type.static final StringGraphML key for a node label.static final StringGraphML key for a node's log-normal distribution.static final StringGraphML key for the proposition observed at a node.static final StringGraphML key indicating whether a node is a parameter node.static final StringGraphML key for labeled potential values at a node.static final StringGraphML key for a node's x coordinate.static final StringGraphML key for a node's y coordinate. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a writer using the persistent coordinates stored in nodes.TCGraphMLWriter(Object ignoredLayout) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionfinal Stringsave(TemporalConstraintGraph<? extends Edge> graph) Returns the GraphML representation ofgraph.final voidsave(TemporalConstraintGraph<? extends Edge> graph, File outputFile) Saves a graph as UTF-8 GraphML.final voidsave(TemporalConstraintGraph<? extends Edge> graph, Writer writer) Writes GraphML towriter.
-
Field Details
-
EDGE_CASE_VALUE_KEY
-
EDGE_LABELED_LC_VALUE_KEY
GraphML key for lower-case labeled values on an edge.- See Also:
-
EDGE_LABELED_UC_VALUE_KEY
GraphML key for upper-case labeled values on an edge.- See Also:
-
EDGE_LABELED_VALUE_KEY
GraphML key for labeled values on an edge.- See Also:
-
EDGE_ROUTE_KEY
GraphML key for the explicit routing of an edge.- See Also:
-
EDGE_TYPE_KEY
-
EDGE_VALUE_KEY
-
GRAPH_ANNOTATIONS_KEY
GraphML key for presentation-only plain-text annotations.- See Also:
-
GRAPH_CHECK_OUTCOME_KEY
GraphML key for a persisted check outcome.- See Also:
-
GRAPH_DISPATCHABILITY_OUTCOME_KEY
GraphML key for a persisted dispatchability representation.- See Also:
-
GRAPH_OUTCOME_FINGERPRINT_KEY
GraphML key for the fingerprint protecting persisted outcomes.- See Also:
-
GRAPH_NAME_KEY
-
GRAPH_nCTG_KEY
GraphML key for the number of contingent nodes in the graph.- See Also:
-
GRAPH_nEDGES_KEY
GraphML key for the number of edges in the graph.- See Also:
-
GRAPH_nOBS_KEY
GraphML key for the number of observed propositions in the graph.- See Also:
-
GRAPH_nVERTICES_KEY
GraphML key for the number of vertices in the graph.- See Also:
-
NETWORK_TYPE_KEY
-
NODE_LABEL_KEY
-
NODE_LOGNORMALDISTRIBUTION_KEY
GraphML key for a node's log-normal distribution.- See Also:
-
NODE_OBSERVED_KEY
GraphML key for the proposition observed at a node.- See Also:
-
NODE_PARAMETER_KEY
GraphML key indicating whether a node is a parameter node.- See Also:
-
NODE_POTENTIAL_KEY
GraphML key for labeled potential values at a node.- See Also:
-
NODE_X_KEY
-
NODE_Y_KEY
-
-
Constructor Details
-
TCGraphMLWriter
public TCGraphMLWriter()Creates a writer using the persistent coordinates stored in nodes. -
TCGraphMLWriter
Deprecated.Source-compatible constructor for old callers that supplied a JUNG layout. Coordinates now belong to nodes, so the layout is deliberately ignored. New code should useTCGraphMLWriter().- Parameters:
ignoredLayout- the former layout argument, retained only for source compatibility and ignored
-
-
Method Details
-
save
public final void save(@Nonnull TemporalConstraintGraph<? extends Edge> graph, @Nonnull File outputFile) throws IOException Saves a graph as UTF-8 GraphML.- Parameters:
graph- the graph to saveoutputFile- the file receiving the GraphML output- Throws:
IOException- if the output file cannot be written
-
save
public final void save(@Nonnull TemporalConstraintGraph<? extends Edge> graph, @Nonnull Writer writer) throws IOException Writes GraphML towriter.- Parameters:
graph- the graph to savewriter- the writer receiving the GraphML output- Throws:
IOException- if the GraphML cannot be written
-
save
Returns the GraphML representation ofgraph.- Parameters:
graph- the graph to save- Returns:
- the GraphML representation of
graph
-