Class DatasetUtilities.PyDataSet
- java.lang.Object
-
- com.inductiveautomation.ignition.common.script.builtin.DatasetUtilities.PyDataSet
-
- All Implemented Interfaces:
Dataset,java.io.Serializable
- Enclosing class:
- DatasetUtilities
public static class DatasetUtilities.PyDataSet extends java.lang.Object implements Dataset
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classDatasetUtilities.PyDataSet.PyRow
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object__getitem__(int index)java.lang.Object__getitem__(org.python.core.PyObject index)java.lang.Object__getslice__(org.python.core.PyObject start, org.python.core.PyObject stop)java.lang.Object__getslice__(org.python.core.PyObject start, org.python.core.PyObject stop, org.python.core.PyObject step)int__len__()org.python.core.PyString__repr__()intbinarySearch(int column, java.lang.Object key)Performs a binary search on the specified column, looking for the specified key.intgetColumnCount()Returns the number of columns.intgetColumnIndex(java.lang.String name)Returns the index of the given column, case insensitivejava.lang.StringgetColumnName(int col)Returns the name of the given column.java.util.List<java.lang.String>getColumnNames()Returns an unmodifiable list of this dataset's column names, in order.java.lang.Class<?>getColumnType(int col)Returns the type of the given column.java.util.List<java.lang.Class<?>>getColumnTypes()Returns an unmodifiable list of this dataset's column types, in order.doublegetPrimitiveValueAt(int row, int col)If the given column is a numeric type or a Date, then the value will be returned as a double.QualityCodegetQualityAt(int row, int col)Returns the quality of the value at the given location.intgetRowCount()Return the number of rows in this datasetDatasetgetUnderlyingDataset()java.lang.ObjectgetValueAt(int row, int col)Returns the value in the dataset at the given location.java.lang.ObjectgetValueAt(int row, java.lang.String colName)Returns the value at the given row and at a column named colName.voidsetData(Dataset data)Used for serialization only.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.inductiveautomation.ignition.common.Dataset
getColumnAsList, hasQualityData
-
-
-
-
Field Detail
-
NO_DATA
protected static final Dataset NO_DATA
-
data
protected Dataset data
-
rows
protected transient DatasetUtilities.PyDataSet.PyRow[] rows
-
-
Constructor Detail
-
PyDataSet
public PyDataSet()
No arg constructor for serialization.
-
PyDataSet
public PyDataSet(Dataset ds)
-
-
Method Detail
-
getUnderlyingDataset
public Dataset getUnderlyingDataset()
-
__getitem__
public java.lang.Object __getitem__(int index)
-
__getitem__
public java.lang.Object __getitem__(org.python.core.PyObject index)
-
__getslice__
public java.lang.Object __getslice__(org.python.core.PyObject start, org.python.core.PyObject stop)
-
__getslice__
public java.lang.Object __getslice__(org.python.core.PyObject start, org.python.core.PyObject stop, org.python.core.PyObject step)
-
__len__
public int __len__()
-
__repr__
public org.python.core.PyString __repr__()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getColumnNames
public java.util.List<java.lang.String> getColumnNames()
Description copied from interface:DatasetReturns an unmodifiable list of this dataset's column names, in order.- Specified by:
getColumnNamesin interfaceDataset
-
getColumnTypes
public java.util.List<java.lang.Class<?>> getColumnTypes()
Description copied from interface:DatasetReturns an unmodifiable list of this dataset's column types, in order.- Specified by:
getColumnTypesin interfaceDataset
-
getColumnCount
public int getColumnCount()
Description copied from interface:DatasetReturns the number of columns.- Specified by:
getColumnCountin interfaceDataset
-
getRowCount
public int getRowCount()
Description copied from interface:DatasetReturn the number of rows in this dataset- Specified by:
getRowCountin interfaceDataset
-
getColumnIndex
public int getColumnIndex(java.lang.String name)
Description copied from interface:DatasetReturns the index of the given column, case insensitive- Specified by:
getColumnIndexin interfaceDataset- Parameters:
name- the name of the column to look up- Returns:
- the index of the column
-
getColumnName
public java.lang.String getColumnName(int col)
Description copied from interface:DatasetReturns the name of the given column.- Specified by:
getColumnNamein interfaceDataset
-
getColumnType
public java.lang.Class<?> getColumnType(int col)
Description copied from interface:DatasetReturns the type of the given column.- Specified by:
getColumnTypein interfaceDataset
-
getValueAt
public java.lang.Object getValueAt(int row, int col)Description copied from interface:DatasetReturns the value in the dataset at the given location.- Specified by:
getValueAtin interfaceDataset
-
getQualityAt
public QualityCode getQualityAt(int row, int col)
Description copied from interface:DatasetReturns the quality of the value at the given location.- Specified by:
getQualityAtin interfaceDataset
-
getValueAt
public java.lang.Object getValueAt(int row, java.lang.String colName)Description copied from interface:DatasetReturns the value at the given row and at a column named colName. Column name matching is case insensitive.- Specified by:
getValueAtin interfaceDataset
-
getPrimitiveValueAt
public double getPrimitiveValueAt(int row, int col)Description copied from interface:DatasetIf the given column is a numeric type or a Date, then the value will be returned as a double. (Charts uses this functionality to provide a seamless interface with certain optimized dataset implementations.- Specified by:
getPrimitiveValueAtin interfaceDataset
-
binarySearch
public int binarySearch(int column, java.lang.Object key)Description copied from interface:DatasetPerforms a binary search on the specified column, looking for the specified key. Column MUST be sorted in ascending order. Dataset provides an inefficient default implementation of binary search that allocates a new array list for the entire column.- Specified by:
binarySearchin interfaceDataset- Returns:
- index of the search key, if it is contained in the list; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the list: the index of the first element greater than the key, or list.size(), if all elements in the list are less than the specified key. Note that this guarantees the return value will be greater than or equal to 0, but only if the key is found.
-
setData
public void setData(Dataset data)
Used for serialization only.- Parameters:
data- If null, creates an empty PyDataSet.
-
-