Class TCGraphMLWriter

java.lang.Object
it.univr.di.cstnu.graph.TCGraphMLWriter

public class TCGraphMLWriter extends Object
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 Details

    • EDGE_CASE_VALUE_KEY

      public static final String EDGE_CASE_VALUE_KEY
      GraphML key for an edge case value.
      See Also:
    • EDGE_LABELED_LC_VALUE_KEY

      public static final String EDGE_LABELED_LC_VALUE_KEY
      GraphML key for lower-case labeled values on an edge.
      See Also:
    • EDGE_LABELED_UC_VALUE_KEY

      public static final String EDGE_LABELED_UC_VALUE_KEY
      GraphML key for upper-case labeled values on an edge.
      See Also:
    • EDGE_LABELED_VALUE_KEY

      public static final String EDGE_LABELED_VALUE_KEY
      GraphML key for labeled values on an edge.
      See Also:
    • EDGE_ROUTE_KEY

      public static final String EDGE_ROUTE_KEY
      GraphML key for the explicit routing of an edge.
      See Also:
    • EDGE_TYPE_KEY

      public static final String EDGE_TYPE_KEY
      GraphML key for the type of edge.
      See Also:
    • EDGE_VALUE_KEY

      public static final String EDGE_VALUE_KEY
      GraphML key for the numeric value of an edge.
      See Also:
    • GRAPH_ANNOTATIONS_KEY

      public static final String GRAPH_ANNOTATIONS_KEY
      GraphML key for presentation-only plain-text annotations.
      See Also:
    • GRAPH_CHECK_OUTCOME_KEY

      public static final String GRAPH_CHECK_OUTCOME_KEY
      GraphML key for a persisted check outcome.
      See Also:
    • GRAPH_DISPATCHABILITY_OUTCOME_KEY

      public static final String GRAPH_DISPATCHABILITY_OUTCOME_KEY
      GraphML key for a persisted dispatchability representation.
      See Also:
    • GRAPH_OUTCOME_FINGERPRINT_KEY

      public static final String GRAPH_OUTCOME_FINGERPRINT_KEY
      GraphML key for the fingerprint protecting persisted outcomes.
      See Also:
    • GRAPH_NAME_KEY

      public static final String GRAPH_NAME_KEY
      GraphML key for the graph name.
      See Also:
    • GRAPH_nCTG_KEY

      public static final String GRAPH_nCTG_KEY
      GraphML key for the number of contingent nodes in the graph.
      See Also:
    • GRAPH_nEDGES_KEY

      public static final String GRAPH_nEDGES_KEY
      GraphML key for the number of edges in the graph.
      See Also:
    • GRAPH_nOBS_KEY

      public static final String GRAPH_nOBS_KEY
      GraphML key for the number of observed propositions in the graph.
      See Also:
    • GRAPH_nVERTICES_KEY

      public static final String GRAPH_nVERTICES_KEY
      GraphML key for the number of vertices in the graph.
      See Also:
    • NETWORK_TYPE_KEY

      public static final String NETWORK_TYPE_KEY
      GraphML key for the network type.
      See Also:
    • NODE_LABEL_KEY

      public static final String NODE_LABEL_KEY
      GraphML key for a node label.
      See Also:
    • NODE_LOGNORMALDISTRIBUTION_KEY

      public static final String NODE_LOGNORMALDISTRIBUTION_KEY
      GraphML key for a node's log-normal distribution.
      See Also:
    • NODE_OBSERVED_KEY

      public static final String NODE_OBSERVED_KEY
      GraphML key for the proposition observed at a node.
      See Also:
    • NODE_PARAMETER_KEY

      public static final String NODE_PARAMETER_KEY
      GraphML key indicating whether a node is a parameter node.
      See Also:
    • NODE_POTENTIAL_KEY

      public static final String NODE_POTENTIAL_KEY
      GraphML key for labeled potential values at a node.
      See Also:
    • NODE_X_KEY

      public static final String NODE_X_KEY
      GraphML key for a node's x coordinate.
      See Also:
    • NODE_Y_KEY

      public static final String NODE_Y_KEY
      GraphML key for a node's y coordinate.
      See Also:
  • Constructor Details

    • TCGraphMLWriter

      public TCGraphMLWriter()
      Creates a writer using the persistent coordinates stored in nodes.
    • TCGraphMLWriter

      @Deprecated public TCGraphMLWriter(Object ignoredLayout)
      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 use TCGraphMLWriter().
      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 save
      outputFile - 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 to writer.
      Parameters:
      graph - the graph to save
      writer - the writer receiving the GraphML output
      Throws:
      IOException - if the GraphML cannot be written
    • save

      @Nonnull public final String save(@Nonnull TemporalConstraintGraph<? extends Edge> graph)
      Returns the GraphML representation of graph.
      Parameters:
      graph - the graph to save
      Returns:
      the GraphML representation of graph