Class ExportManager

java.lang.Object
com.sparsity.sparksee.gdb.ExportManager
Direct Known Subclasses:
DefaultExport

public class ExportManager extends Object
Defines how to export a graph to an external format.

This is an interface which must be implemented by the user. While the export proces, a call for each node or edge type and node or edge object is done to get how to export that element.

It is possible to export a Graph to a diferent fortmats. Nowadays, available formats are defined in the ExportType enum.

Author:
Sparsity Technologies http://www.sparsity-technologies.com
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    enableType(int type)
    Gets whether a node or edge type must be exported or not.
    boolean
    Get if all the graph object should be exported or only a subgraph It should return true (default option), to export all the nodes and edges in the Graph as with previous verions.
    boolean
    getEdge(long edge, EdgeExport edgeExport)
    Gets the edge export definition for the given edge.
    boolean
    getEdgeType(int type, EdgeExport edgeExport)
    Gets the default node export definition for the given edge type.
    boolean
    getGraph(GraphExport graphExport)
    Gets the graph export definition.
    boolean
    getNode(long node, NodeExport nodeExport)
    Gets the node export definition for the given node.
    boolean
    getNodeType(int type, NodeExport nodeExport)
    Gets the default node export definition for the given node type.
    long
    Gets the next edge to export or InvalidOID.
    long
    Gets the next node to export or InvalidOID.
    void
    prepare(Graph graph)
    Prepares the graph for the export process.
    void
    Ends the export process.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getEdge

      public boolean getEdge(long edge, EdgeExport edgeExport)
      Gets the edge export definition for the given edge.

      Parameters:
      edge - Edge identifier.
      edgeExport - [out] The EdgeExport which defines how to export given edge.
      Returns:
      TRUE if the given EdgeExport has been updated, otherwise FALSE will be returned and the default EdgeExport for the type the edge belongs to will be used.
    • release

      public void release()
      Ends the export process.

      It is called once after the export process.

    • getGraph

      public boolean getGraph(GraphExport graphExport)
      Gets the graph export definition.

      Parameters:
      graphExport - [out] The GraphExport which defines how to export the graph.
      Returns:
      TRUE.
    • nextEdge

      public long nextEdge()
      Gets the next edge to export or InvalidOID.

      It will return valid edge OIDs to export and InvalidOID when there is not any more edges to export. ExportAll returns false.

      Returns:
      oid_t Return an edge OID or InvalidOID
    • getNode

      public boolean getNode(long node, NodeExport nodeExport)
      Gets the node export definition for the given node.

      Parameters:
      node - Node identifier.
      nodeExport - [out] The NodeExport which defines how to export given node.
      Returns:
      TRUE if the given NodeExport has been updated, otherwise FALSE will be returned and the default NodeExport for the type the node belongs to will be used.
    • nextNode

      public long nextNode()
      Gets the next node to export or InvalidOID.

      It will return valid node OIDs to export and InvalidOID when there is not any more nodes to export. ExportAll returns false.

      Returns:
      oid_t Return a node OID or InvalidOID
    • getNodeType

      public boolean getNodeType(int type, NodeExport nodeExport)
      Gets the default node export definition for the given node type.

      GetNode has a higher priority than this function. That is, only if GetNode returns FALSE, the NodeExport of this function will be used.

      Parameters:
      type - [in] Node type identifier.
      nodeExport - [out] The NodeExport which defines how to export the nodes of the given type.
      Returns:
      TRUE.
    • exportAll

      public boolean exportAll()
      Get if all the graph object should be exported or only a subgraph It should return true (default option), to export all the nodes and edges in the Graph as with previous verions.

      Or false to use the new NextNode() and NextEdge() methods of this class to get the only nodes/edges that should be exported.

      Returns:
      bool_t Returns true to export all the graph or false otherwise.
    • enableType

      public boolean enableType(int type)
      Gets whether a node or edge type must be exported or not.

      Parameters:
      type - Node or edge type identifier.
      Returns:
      If TRUE all objects of the given type will be exported, otherwise they will not be exported.
    • prepare

      public void prepare(Graph graph)
      Prepares the graph for the export process.

      It is called once before the export process.

      Parameters:
      graph - Graph to be exported.
    • getEdgeType

      public boolean getEdgeType(int type, EdgeExport edgeExport)
      Gets the default node export definition for the given edge type.

      GetEdge has a higher priority than this function. That is, only if GetEdge returns FALSE, the EdgeExport of this function will be used.

      Parameters:
      type - [in] Edge type identifier.
      edgeExport - [out] The EdgeExport which defines how to export the edges of the given type.
      Returns:
      TRUE.