Class JavaDataFrameFactory

    • Constructor Detail

      • JavaDataFrameFactory

        public JavaDataFrameFactory()
    • Method Detail

      • 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 class CPDataFrameFactory
        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 connection
        password - the password to authenticate the connection
        query - 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 connection
        password - the password to authenticate the connection
        query - 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 connection
        password - the password to authenticate the connection
        query - 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 connection
        password - the password to authenticate the connection
        query - 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 connection
        password - the password to authenticate the connection
        query - 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
      • main

        public static void main​(java.lang.String[] args)