GraphLab Project

graphlab.plugins.main.saveload
Class Load

java.lang.Object
  extended by graphlab.plugins.main.saveload.Load
All Implemented Interfaces:
BasicExtension, Extension, GraphReaderExtension, GraphReaderInterface

public class Load
extends java.lang.Object
implements GraphReaderExtension


Constructor Summary
Load()
           
 
Method Summary
 boolean accepts(java.io.File file)
          Reads the file and enters the data in the graph.
 java.lang.String getDescription()
           
 java.lang.String getExtension()
          Retrieves the file extension for the file type.
 java.lang.String getName()
          Retrieves the name of the file type.
static GraphModel loadGraphFromFile(java.io.File selectedFile)
          loads a graph from a file, note that this method clears the graph first
 GraphModel read(java.io.File file)
          Reads the file and enters the data in the graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Load

public Load()
Method Detail

loadGraphFromFile

public static GraphModel loadGraphFromFile(java.io.File selectedFile)
                                    throws java.io.IOException,
                                           javax.xml.parsers.ParserConfigurationException,
                                           org.xml.sax.SAXException
loads a graph from a file, note that this method clears the graph first

Parameters:
selectedFile -
g -
Throws:
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException

accepts

public boolean accepts(java.io.File file)
Description copied from interface: GraphReaderInterface
Reads the file and enters the data in the graph. The method gets an empty graph object, and initializes it with the data from the file.

Specified by:
accepts in interface GraphReaderInterface
Parameters:
file - the file
Returns:
boolean Indicates whether the file is acceptable for reading.

getName

public java.lang.String getName()
Description copied from interface: GraphReaderInterface
Retrieves the name of the file type.

Specified by:
getName in interface Extension
Specified by:
getName in interface GraphReaderInterface
Returns:
the Name

getExtension

public java.lang.String getExtension()
Description copied from interface: GraphReaderInterface
Retrieves the file extension for the file type. Example: "xml", "gr".

Specified by:
getExtension in interface GraphReaderInterface
Returns:
the Extension

read

public GraphModel read(java.io.File file)
                throws GraphIOException
Description copied from interface: GraphReaderInterface
Reads the file and enters the data in the graph. The method gets an empty graph, and initializes it with the data from the file.

Specified by:
read in interface GraphReaderInterface
Throws:
GraphIOException - In the case of the reader error.

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface Extension

GraphLab Project