Package com.macrofocus.molap.dataframe
Class JavaDataFrameFactory
- java.lang.Object
-
- com.macrofocus.molap.dataframe.AbstractDataFrameFactory
-
- com.macrofocus.molap.dataframe.CPDataFrameFactory
-
- com.macrofocus.molap.dataframe.JavaDataFrameFactory
-
- All Implemented Interfaces:
DataFrameFactory
- Direct Known Subclasses:
SwingDataFrameFactory
public class JavaDataFrameFactory extends CPDataFrameFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JavaDataFrameFactory.AccessLogColumn
static class
JavaDataFrameFactory.ApacheAccessLog
This class represents an Apache access log line.-
Nested classes/interfaces inherited from interface com.macrofocus.molap.dataframe.DataFrameFactory
DataFrameFactory.Callback
-
-
Constructor Summary
Constructors Constructor Description JavaDataFrameFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DataFrame<JavaDataFrameFactory.ApacheAccessLog,JavaDataFrameFactory.AccessLogColumn,java.lang.Object>
fromAccessLog(java.io.File file)
static DataFrame<JavaDataFrameFactory.ApacheAccessLog,JavaDataFrameFactory.AccessLogColumn,java.lang.Object>
fromAccessLog(java.io.InputStream is)
static DataFrame<JavaDataFrameFactory.ApacheAccessLog,JavaDataFrameFactory.AccessLogColumn,java.lang.Object>
fromAccessLog(java.net.URL url)
static DefaultDataFrame<java.lang.Object>
fromBinary(java.io.File file)
static DefaultDataFrame<java.lang.Object>
fromBinary(java.io.File file, java.awt.Component parentComponent)
static DefaultDataFrame<java.lang.Object>
fromBinary(java.io.InputStream is)
static DefaultDataFrame<java.lang.Object>
fromBinary(java.net.URL url)
static MutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
fromCSV(java.net.URL url)
Creates a data frame by loading a Comma-Separated Values (CSV) encoded file.static MutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
fromCSV(java.net.URL url, java.lang.String defaultCharset)
Creates a data frame by loading a Comma-Separated Values (CSV) encoded file.static MutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
fromExcel(java.net.URL url)
Creates a data frame by loading an Excel (.xls, .xlsx) file.static MutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
fromExcel(java.net.URL url, java.lang.String sheetName)
Creates a data frame by loading an Excel (.xls, .xlsx) file.MutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
fromJSON(java.net.URL url)
Creates a data frame by loading a JSON encoded file.static DataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
fromMySQL(java.lang.String url, java.lang.String username, java.lang.String password, java.lang.String query)
Creates a data frame by retrieving the result of a query made to a MySQL database.static DataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
fromOracle(java.lang.String url, java.lang.String username, java.lang.String password, java.lang.String query)
Creates a data frame by retrieving the result of a query made to an Oracle database.static DataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
fromPostGIS(java.lang.String url, java.lang.String username, java.lang.String password, java.lang.String query)
Creates a data frame by retrieving the result of a query made to a PostGIS database.static DataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
fromPostgreSQL(java.lang.String url, java.lang.String username, java.lang.String password, java.lang.String query)
Creates a data frame by retrieving the result of a query made to a PostgreSQL database.static MutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
fromSerialize(java.net.URL url)
static DataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
fromSQLServer(java.lang.String url, java.lang.String username, java.lang.String password, java.lang.String query)
Creates a data frame by retrieving the result of a query made to a Microsoft SQL Server database.static <V> MutableDataFrame<java.lang.Integer,java.lang.String,V>
fromTableModel(javax.swing.table.TableModel tableModel)
Creates a data frame using a Swing TableModel.static MutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
fromTSV(java.net.URL url, com.macrofocus.data.typemap.TypemapModel.Builder... builders)
Creates a data frame by loading a tab-delimited encoded file.static JavaDataFrameFactory
getInstance()
static void
main(java.lang.String[] args)
-
Methods inherited from class com.macrofocus.molap.dataframe.CPDataFrameFactory
fromJson, fromJSON, fromRowMajorArray
-
Methods inherited from class com.macrofocus.molap.dataframe.AbstractDataFrameFactory
createRandomDataFrame, fromColumnSeries, fromDataFrame, fromJsonString, fromJsonString, fromJsonValue
-
-
-
-
Method Detail
-
getInstance
public static JavaDataFrameFactory getInstance()
-
fromJSON
public MutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object> fromJSON(java.net.URL url) throws java.io.IOException
Description copied from class:CPDataFrameFactory
Creates a data frame by loading a JSON encoded file. The macrofocus-data.jar library is required to use this method.- Overrides:
fromJSON
in classCPDataFrameFactory
- Parameters:
url
- the URL of the file- Returns:
- a newly created data frame
- Throws:
java.io.IOException
-
fromTableModel
public static <V> MutableDataFrame<java.lang.Integer,java.lang.String,V> fromTableModel(javax.swing.table.TableModel tableModel)
Creates a data frame using a Swing TableModel.- Type Parameters:
V
- the type of values- Parameters:
tableModel
- the table model- Returns:
- a newly created data frame.
-
fromSerialize
public static MutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object> fromSerialize(java.net.URL url) throws java.io.IOException
- Throws:
java.io.IOException
-
fromCSV
public static MutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object> fromCSV(java.net.URL url) throws java.io.IOException
Creates a data frame by loading a Comma-Separated Values (CSV) encoded file. The macrofocus-data.jar library is required to use this method.- Parameters:
url
- the URL of the file- Returns:
- a newly created data frame
- Throws:
java.io.IOException
-
fromCSV
public static MutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object> fromCSV(java.net.URL url, java.lang.String defaultCharset) throws java.io.IOException
Creates a data frame by loading a Comma-Separated Values (CSV) encoded file. The macrofocus-data.jar library is required to use this method.- Parameters:
url
- the URL of the file- Returns:
- a newly created data frame
- Throws:
java.io.IOException
-
fromTSV
public static MutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object> fromTSV(java.net.URL url, com.macrofocus.data.typemap.TypemapModel.Builder... builders) throws java.io.IOException
Creates a data frame by loading a tab-delimited encoded file. The macrofocus-data.jar library is required to use this method.- Parameters:
url
- the URL of the file- Returns:
- a newly created data frame
- Throws:
java.io.IOException
-
fromExcel
public static MutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object> fromExcel(java.net.URL url) throws java.io.IOException
Creates a data frame by loading an Excel (.xls, .xlsx) file. The macrofocus-data.jar and POI libraries are required to use this method.- Parameters:
url
- the URL of the file- Returns:
- a newly created data frame
- Throws:
java.io.IOException
-
fromExcel
public static MutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object> fromExcel(java.net.URL url, java.lang.String sheetName) throws java.io.IOException
Creates a data frame by loading an Excel (.xls, .xlsx) file. The macrofocus-data.jar and POI libraries are required to use this method.- Parameters:
url
- the URL of the file- Returns:
- a newly created data frame
- Throws:
java.io.IOException
-
fromMySQL
public static DataFrame<java.lang.Integer,java.lang.String,java.lang.Object> fromMySQL(java.lang.String url, java.lang.String username, java.lang.String password, java.lang.String query) throws java.io.IOException, java.sql.SQLException
Creates a data frame by retrieving the result of a query made to a MySQL database. The macrofocus-data.jar library is required to use this method.- Parameters:
url
- the JDBC URL, e.g. "jdbc:mysql://mysql.example.com:3306/mydatabase"username
- the username to authenticate the connectionpassword
- the password to authenticate the connectionquery
- the SQL query to submit, e.g. "SELECT * FROM mytable";- Returns:
- a newly created data frame
- Throws:
java.io.IOException
java.sql.SQLException
-
fromPostgreSQL
public static DataFrame<java.lang.Integer,java.lang.String,java.lang.Object> fromPostgreSQL(java.lang.String url, java.lang.String username, java.lang.String password, java.lang.String query) throws java.io.IOException, java.sql.SQLException
Creates a data frame by retrieving the result of a query made to a PostgreSQL database. The macrofocus-data.jar library is required to use this method.- Parameters:
url
- the JDBC URL, e.g. "jdbc:postgresql://mysql.example.com/mydatabase"username
- the username to authenticate the connectionpassword
- the password to authenticate the connectionquery
- the SQL query to submit, e.g. "SELECT * FROM mytable";- Returns:
- a newly created data frame
- Throws:
java.io.IOException
java.sql.SQLException
-
fromPostGIS
public static DataFrame<java.lang.Integer,java.lang.String,java.lang.Object> fromPostGIS(java.lang.String url, java.lang.String username, java.lang.String password, java.lang.String query) throws java.io.IOException, java.sql.SQLException
Creates a data frame by retrieving the result of a query made to a PostGIS database. The macrofocus-data.jar library is required to use this method.- Parameters:
url
- the JDBC URL, e.g. "jdbc:postgresql://mysql.example.com/mydatabase"username
- the username to authenticate the connectionpassword
- the password to authenticate the connectionquery
- the SQL query to submit, e.g. "SELECT * FROM mytable";- Returns:
- a newly created data frame
- Throws:
java.io.IOException
java.sql.SQLException
-
fromOracle
public static DataFrame<java.lang.Integer,java.lang.String,java.lang.Object> fromOracle(java.lang.String url, java.lang.String username, java.lang.String password, java.lang.String query) throws java.io.IOException, java.sql.SQLException
Creates a data frame by retrieving the result of a query made to an Oracle database. The macrofocus-data.jar library is required to use this method.- Parameters:
url
- the JDBC URL, e.g. "jdbc:oracle:thin://oracle.example.com/mydatabase"username
- the username to authenticate the connectionpassword
- the password to authenticate the connectionquery
- the SQL query to submit, e.g. "SELECT * FROM mytable";- Returns:
- a newly created data frame
- Throws:
java.io.IOException
java.sql.SQLException
-
fromSQLServer
public static DataFrame<java.lang.Integer,java.lang.String,java.lang.Object> fromSQLServer(java.lang.String url, java.lang.String username, java.lang.String password, java.lang.String query) throws java.io.IOException, java.sql.SQLException
Creates a data frame by retrieving the result of a query made to a Microsoft SQL Server database. The macrofocus-data.jar library is required to use this method.- Parameters:
url
- the JDBC URL, e.g. "jdbc:sqlserver://sqlserver.example.com/mydatabase"username
- the username to authenticate the connectionpassword
- the password to authenticate the connectionquery
- the SQL query to submit, e.g. "SELECT * FROM mytable";- Returns:
- a newly created data frame
- Throws:
java.io.IOException
java.sql.SQLException
-
fromBinary
public static DefaultDataFrame<java.lang.Object> fromBinary(java.io.File file, java.awt.Component parentComponent) throws java.io.IOException
- Throws:
java.io.IOException
-
fromBinary
public static DefaultDataFrame<java.lang.Object> fromBinary(java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
fromBinary
public static DefaultDataFrame<java.lang.Object> fromBinary(java.io.InputStream is) throws java.io.IOException
- Throws:
java.io.IOException
-
fromBinary
public static DefaultDataFrame<java.lang.Object> fromBinary(java.net.URL url) throws java.io.IOException
- Throws:
java.io.IOException
-
fromAccessLog
public static DataFrame<JavaDataFrameFactory.ApacheAccessLog,JavaDataFrameFactory.AccessLogColumn,java.lang.Object> fromAccessLog(java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
fromAccessLog
public static DataFrame<JavaDataFrameFactory.ApacheAccessLog,JavaDataFrameFactory.AccessLogColumn,java.lang.Object> fromAccessLog(java.net.URL url) throws java.io.IOException
- Throws:
java.io.IOException
-
fromAccessLog
public static DataFrame<JavaDataFrameFactory.ApacheAccessLog,JavaDataFrameFactory.AccessLogColumn,java.lang.Object> fromAccessLog(java.io.InputStream is) throws java.io.IOException
- Throws:
java.io.IOException
-
main
public static void main(java.lang.String[] args)
-
-