Package com.macrofocus.molap.dataframe
Class CPDataFrameFactory
- java.lang.Object
-
- com.macrofocus.molap.dataframe.AbstractDataFrameFactory
-
- com.macrofocus.molap.dataframe.CPDataFrameFactory
-
- All Implemented Interfaces:
DataFrameFactory
- Direct Known Subclasses:
JavaDataFrameFactory
public class CPDataFrameFactory extends AbstractDataFrameFactory
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.macrofocus.molap.dataframe.DataFrameFactory
DataFrameFactory.Callback
-
-
Constructor Summary
Constructors Constructor Description CPDataFrameFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fromJson(java.lang.String url, DataFrameFactory.Callback callback)
Creates a data frame by loading a JSON encoded file.MutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object>
fromJSON(java.lang.String url)
Creates a data frame by loading a JSON encoded 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 <V> MutableDataFrame<java.lang.Integer,java.lang.String,V>
fromRowMajorArray(java.lang.String[] names, java.lang.Class[] classes, V[][] data)
Creates a data frame using a row-major two dimensional array.static CPDataFrameFactory
getInstance()
-
Methods inherited from class com.macrofocus.molap.dataframe.AbstractDataFrameFactory
createRandomDataFrame, fromColumnSeries, fromDataFrame, fromJsonString, fromJsonString, fromJsonValue
-
-
-
-
Method Detail
-
getInstance
public static CPDataFrameFactory getInstance()
-
fromRowMajorArray
public static <V> MutableDataFrame<java.lang.Integer,java.lang.String,V> fromRowMajorArray(java.lang.String[] names, java.lang.Class[] classes, V[][] data)
Creates a data frame using a row-major two dimensional array.- Type Parameters:
V
- the type of values- Parameters:
names
- the column namesclasses
- the type of values hold by each columndata
- the data array- Returns:
- a newly created data frame.
-
fromJson
public void fromJson(java.lang.String url, DataFrameFactory.Callback callback) throws java.io.IOException
Description copied from interface:DataFrameFactory
Creates a data frame by loading a JSON encoded file.- Parameters:
url
- the URL of the filecallback
- call back method- Throws:
java.io.IOException
-
fromJSON
public MutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object> fromJSON(java.lang.String url) throws java.io.IOException
Creates a data frame by loading a JSON 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
-
fromJSON
public MutableDataFrame<java.lang.Integer,java.lang.String,java.lang.Object> fromJSON(java.net.URL url) throws java.io.IOException
Creates a data frame by loading a JSON 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
-
-