Class DatasetUtilities
java.lang.Object
com.inductiveautomation.ignition.common.script.builtin.DatasetUtilities
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic DatasetaddColumn(Dataset ds, int colId, org.python.core.PySequence col, String colName, org.python.core.PyType colType) static DatasetaddColumn(Dataset ds, org.python.core.PySequence col, String colName, org.python.core.PyType colType) static Datasetstatic Datasetstatic Datasetstatic Datasetstatic DatasetappendDataset(Dataset ds1, Dataset ds2) static DatasetclearDataset(Dataset ds) static StringdataSetToCSV(boolean headerRow, Dataset ds) Deprecated.static StringdataSetToExcel(boolean headerRow, Object[] datasets) static StringdataSetToExcel(boolean headerRow, Object[] datasets, boolean nullsEmpty) Deprecated.static byte[]dataSetToExcelBytes(boolean headerRow, Object[] objects, boolean nullsEmpty, String[] sheetNames) static voiddataSetToExcelStreaming(boolean headerRow, Object[] objects, OutputStream out, boolean nullsEmpty) static voiddataSetToExcelStreaming(boolean headerRow, Object[] datasets, Writer out, boolean nullsEmpty) Deprecated.static StringdataSetToHTML(boolean headerRow, Dataset ds, String title) static voiddataSetToHTMLStreaming(boolean headerRow, Dataset ds, String title, Writer fw) static Datasetstatic DatasetdeleteRows(Dataset ds, int[] rows) static DatasetfilterColumns(Dataset dataset, org.python.core.PySequence columns) static DatasetformatDates(Dataset dataset, String format) static DatasetformatDates(Dataset dataset, String format, Locale locale) Returns a new dataset with all date columns changed to Strings, and the dates formatted as stringsstatic Datasetstatic DatasetfromCSVJava(String csv) A special version of fromCSV that throws Java exceptions rather than wrapped, uncaught python exceptionsstatic org.python.core.PyListstatic DatasetinsertColumn(Dataset ds, int colId, Object[] col, String colName, Class colType) static DatasetinsertColumn(Dataset ds, int colId, org.python.core.PySequence col, String colName, org.python.core.PyType colType) static DatasetinsertColumn(Dataset ds, org.python.core.PySequence row, String colName, org.python.core.PyType colType) static Datasetstatic Datasetstatic Datasetstatic Datasetstatic Datasetstatic Datasetstatic Datasetstatic Datasetstatic Datasetstatic Datasetstatic Datasetstatic Datasetstatic Stringstatic Stringstatic Stringstatic voidtoCSVJavaStreaming(Dataset ds, Boolean showHeaders, boolean forExport, Writer sw, boolean localized) static Datasetstatic DatasettoDataSet(org.python.core.PySequence headers, org.python.core.PySequence pyData) static byte[]Exports 1 or moreDatasets to excel.static JSONObjecttoJSONObject(Dataset data) Returns a JSON object in the format of:static DatasetUtilities.PyDataSettoPyDataSet(Dataset dataset) static Dataset
- 
Constructor Details- 
DatasetUtilitiespublic DatasetUtilities()
 
- 
- 
Method Details- 
sort
- 
sort
- 
sort
- 
sort
- 
sort
- 
sort
- 
formatDates- Throws:
- IllegalArgumentException
 
- 
formatDatespublic static Dataset formatDates(Dataset dataset, String format, Locale locale) throws IllegalArgumentException Returns a new dataset with all date columns changed to Strings, and the dates formatted as strings- Parameters:
- dataset- Dataset to format
- format- Date format to use
- locale- Locale to use. If null, default will be used.
- Returns:
- New dataset, formatted. If there are no date columns, original dataset is returned.
- Throws:
- IllegalArgumentException- is date format is not valid
 
- 
toPyDataSet
- 
toDataSet
- 
toDataSetpublic static Dataset toDataSet(org.python.core.PySequence headers, org.python.core.PySequence pyData) 
- 
filterColumnspublic static Dataset filterColumns(Dataset dataset, org.python.core.PySequence columns) throws Exception - Throws:
- Exception
 
- 
fromCSV
- 
fromCSVJavapublic static Dataset fromCSVJava(String csv) throws IOException, ClassNotFoundException, IllegalArgumentException A special version of fromCSV that throws Java exceptions rather than wrapped, uncaught python exceptions
- 
toCSV
- 
toCSVJava
- 
toCSVJava
- 
toCSVJavaStreaming
- 
toJSONObjectReturns a JSON object in the format of:{ "columns": [ { "name": "col_1", "type": "java.lang.Integer" }, { "name": "col_2", "type": "java.lang.Integer" }, { "name": "col_3", "type": "java.lang.Integer" }], "rows": [ [ 1, 2, "hello" ], [ 3, 8, "whatever" ]] }
- 
dataSetToCSVDeprecated.
- 
dataSetToHTML
- 
dataSetToHTMLStreamingpublic static void dataSetToHTMLStreaming(boolean headerRow, Dataset ds, String title, Writer fw) throws IOException - Throws:
- IOException
 
- 
dataSetToExcel@Deprecated public static String dataSetToExcel(boolean headerRow, Object[] datasets, boolean nullsEmpty) Deprecated.Exports 1 or more datasets to excel.- Parameters:
- datasets- An array of Datasets or PyDataSets. Each dataset will be on a separate sheet.
 
- 
dataSetToExcel
- 
toExcelpublic static byte[] toExcel(org.python.core.PyObject[] pyArgs, String[] keywords) throws IOException Exports 1 or moreDatasets to excel.- Throws:
- IOException
 
- 
dataSetToExcelStreaming@Deprecated public static void dataSetToExcelStreaming(boolean headerRow, Object[] datasets, Writer out, boolean nullsEmpty) throws IOException Deprecated.- Throws:
- IOException
 
- 
dataSetToExcelStreamingpublic static void dataSetToExcelStreaming(boolean headerRow, Object[] objects, OutputStream out, boolean nullsEmpty) 
- 
dataSetToExcelBytes
- 
addRowpublic static Dataset addRow(Dataset ds, org.python.core.PySequence row) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
- 
addRowpublic static Dataset addRow(Dataset ds, int rowId, org.python.core.PySequence row) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
- 
insertRowpublic static Dataset insertRow(Dataset ds, org.python.core.PySequence row) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
- 
insertRowpublic static Dataset insertRow(Dataset ds, int rowId, org.python.core.PySequence row) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
- 
addRowspublic static Dataset addRows(Dataset ds, org.python.core.PySequence[] rows) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
- 
addRowspublic static Dataset addRows(Dataset ds, int rowId, org.python.core.PySequence[] rows) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
- 
appendDataset- Throws:
- org.python.core.PyException
 
- 
clearDataset
- 
addColumnpublic static Dataset addColumn(Dataset ds, org.python.core.PySequence col, String colName, org.python.core.PyType colType) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
- 
addColumnpublic static Dataset addColumn(Dataset ds, int colId, org.python.core.PySequence col, String colName, org.python.core.PyType colType) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
- 
insertColumnpublic static Dataset insertColumn(Dataset ds, org.python.core.PySequence row, String colName, org.python.core.PyType colType) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
- 
insertColumnpublic static Dataset insertColumn(Dataset ds, int colId, org.python.core.PySequence col, String colName, org.python.core.PyType colType) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
- 
insertColumnpublic static Dataset insertColumn(Dataset ds, int colId, Object[] col, String colName, Class colType) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
- 
getColumnHeaderspublic static org.python.core.PyList getColumnHeaders(Dataset ds) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
- 
removeRow- Throws:
- org.python.core.PyException
 
- 
deleteRow- Throws:
- org.python.core.PyException
 
- 
deleteRows- Throws:
- org.python.core.PyException
 
- 
updateRowpublic static Dataset updateRow(Dataset ds, int row, org.python.core.PyDictionary changes) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
- 
setValuepublic static Dataset setValue(Dataset ds, int row, String col, org.python.core.PyObject value) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
- 
setValuepublic static Dataset setValue(Dataset ds, int row, int col, org.python.core.PyObject value) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
- 
setValuepublic static Dataset setValue(Dataset ds, int row, int col, Object value) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 
-