01: package prefuse.data.io;
02:
03: import java.io.File;
04: import java.io.InputStream;
05: import java.net.URL;
06:
07: import prefuse.data.Table;
08:
09: /**
10: * Interface for classes that read in Table data from a particular file format.
11: *
12: * @author <a href="http://jheer.org">jeffrey heer</a>
13: */
14: public interface TableReader {
15:
16: /**
17: * Read in a table from the file at the given location. Though
18: * not required by this interface, the String is typically resolved
19: * using the {@link prefuse.util.io.IOLib#streamFromString(String)} method,
20: * allowing URLs, classpath references, and files on the file system
21: * to be accessed.
22: * @param location the location to read the table from
23: * @return the loaded Table
24: * @throws DataIOException
25: * @see prefuse.util.io.IOLib#streamFromString(String)
26: */
27: public Table readTable(String location) throws DataIOException;
28:
29: /**
30: * Read in a table from the given URL.
31: * @param url the url to read the graph from
32: * @return the loaded Table
33: * @throws DataIOException
34: */
35: public Table readTable(URL url) throws DataIOException;
36:
37: /**
38: * Read in a table from the given File.
39: * @param f the file to read the table from
40: * @return the loaded Table
41: * @throws DataIOException
42: */
43: public Table readTable(File f) throws DataIOException;
44:
45: /**
46: * Read in a table from the given InputStream.
47: * @param is the InputStream to read the table from
48: * @return the loaded Table
49: * @throws DataIOException
50: */
51: public Table readTable(InputStream is) throws DataIOException;
52:
53: } // end of interface TableReader
|