Class DatasetUtilities.PyDataSet

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  DatasetUtilities.PyDataSet.PyRow  
      • Nested classes/interfaces inherited from class org.python.core.PySequence

        org.python.core.PySequence.DefaultIndexDelegate
      • Nested classes/interfaces inherited from class org.python.core.PyObject

        org.python.core.PyObject.ConversionException
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Dataset data  
      protected DatasetUtilities.PyDataSet.PyRow[] rows  
      • Fields inherited from class org.python.core.PySequence

        delegator
      • Fields inherited from class org.python.core.PyObject

        attributes, gcMonitorGlobal, objtype, TYPE
    • Constructor Summary

      Constructors 
      Constructor Description
      PyDataSet()
      No arg constructor for serialization.
      PyDataSet​(Dataset ds)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.python.core.PyObject __add__​(org.python.core.PyObject other)  
      int __len__()  
      int binarySearch​(int column, java.lang.Object key)
      Performs a binary search on the specified column, looking for the specified key.
      org.python.core.PyInteger count​(org.python.core.PyObject element)
      Return occurrences of element in sequence.
      int getColumnCount()
      Returns the number of columns.
      int getColumnIndex​(java.lang.String name)
      Returns the index of the given column, case insensitive
      java.lang.String getColumnName​(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.
      double getPrimitiveValueAt​(int row, int col)
      If the given column is a numeric type or a Date, then the value will be returned as a double.
      QualityCode getQualityAt​(int row, int col)
      Returns the quality of the value at the given location.
      int getRowCount()
      Return the number of rows in this dataset
      Dataset getUnderlyingDataset()  
      java.lang.Object getValueAt​(int row, int col)
      Returns the value in the dataset at the given location.
      java.lang.Object getValueAt​(int row, java.lang.String colName)
      Returns the value at the given row and at a column named colName.
      int index​(org.python.core.PyObject element)
      Returns the position of the first occurrence of element in the sequence.
      protected org.python.core.PyObject pyget​(int index)  
      protected org.python.core.PyObject repeat​(int count)
      Implements the repeat operation, which is used by Jython when performing sequence * count, which returns a new list containing sequence * count items.
      void setData​(Dataset data)
      Used for serialization only.
      protected java.util.List<? extends org.python.core.PyObject> sublist​(int start, int stop)
      Retrieve a subset of this sequence, from start (inclusive) to stop (exclusive).
      java.lang.String toString()  
      • Methods inherited from class org.python.core.PySequence

        __delitem__, __delslice__, __eq__, __finditem__, __finditem__, __ge__, __getitem__, __getslice__, __gt__, __iter__, __le__, __lt__, __ne__, __nonzero__, __setitem__, __setitem__, __setslice__, __tojava__, boundToSequence, cmp, del, delRange, delslice, fastSequence, isSubType, pyset, runsupportedopMessage, setslice, sliceLength, unsupportedopMessage
      • Methods inherited from class org.python.core.PyObject

        __abs__, __and__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __cmp__, __coerce__, __coerce_ex__, __complex__, __contains__, __delattr__, __delattr__, __delete__, __delitem__, __delslice__, __dir__, __div__, __divmod__, __ensure_finalizer__, __findattr__, __findattr__, __findattr_ex__, __finditem__, __float__, __floordiv__, __format__, __get__, __getattr__, __getattr__, __getitem__, __getnewargs__, __getslice__, __hash__, __hex__, __iadd__, __iand__, __idiv__, __idivmod__, __ifloordiv__, __ilshift__, __imod__, __imul__, __index__, __int__, __invert__, __ior__, __ipow__, __irshift__, __isub__, __iternext__, __itruediv__, __ixor__, __long__, __lshift__, __mod__, __neg__, __not__, __oct__, __or__, __pos__, __pow__, __pow__, __radd__, __rand__, __rawdir__, __rdiv__, __rdivmod__, __reduce__, __reduce_ex__, __reduce_ex__, __rfloordiv__, __rlshift__, __rmod__, __ror__, __rpow__, __rrshift__, __rshift__, __rsub__, __rtruediv__, __rxor__, __set__, __setattr__, __setattr__, __setitem__, __setslice__, __sub__, __truediv__, __trunc__, __unicode__, __xor__, _add, _and, _callextra, _cmp, _div, _divmod, _doget, _doget, _doset, _eq, _floordiv, _ge, _gt, _iadd, _iand, _idiv, _idivmod, _ifloordiv, _ilshift, _imod, _imul, _in, _ior, _ipow, _irshift, _is, _isnot, _isub, _itruediv, _ixor, _jcall, _jcallexc, _jthrow, _le, _lshift, _lt, _mod, _mul, _ne, _notin, _or, _pow, _rshift, _sub, _truediv, _unsupportedop, _xor, adaptToCoerceTuple, asDouble, asIndex, asIndex, asInt, asInt, asIterable, asLong, asLong, asName, asName, asString, asString, asStringOrNull, asStringOrNull, bit_length, conjugate, delDict, delType, dispatch__init__, equals, fastGetClass, fastGetDict, finalize, getDict, getJavaProxy, getType, hashCode, impAttr, implementsDescrDelete, implementsDescrGet, implementsDescrSet, invoke, invoke, invoke, invoke, invoke, invoke, isCallable, isDataDescr, isIndex, isInteger, mergeClassDict, mergeDictAttr, mergeListAttr, noAttributeError, object___subclasshook__, readonlyAttributeError, setDict, setType
      • Methods inherited from class java.lang.Object

        clone, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PyDataSet

        public PyDataSet()
        No arg constructor for serialization.
      • PyDataSet

        public PyDataSet​(Dataset ds)
    • Method Detail

      • getUnderlyingDataset

        public Dataset getUnderlyingDataset()
      • index

        public int index​(org.python.core.PyObject element)
                  throws org.python.core.PyIgnoreMethodTag
        Description copied from interface: JythonSequence
        Returns the position of the first occurrence of element in the sequence.
        Specified by:
        index in interface JythonSequence
        Throws:
        org.python.core.PyIgnoreMethodTag
      • count

        public org.python.core.PyInteger count​(org.python.core.PyObject element)
                                        throws org.python.core.PyIgnoreMethodTag
        Description copied from interface: JythonSequence
        Return occurrences of element in sequence.
        Specified by:
        count in interface JythonSequence
        Throws:
        org.python.core.PyIgnoreMethodTag
      • __len__

        public int __len__()
        Specified by:
        __len__ in interface JythonSequence
        Overrides:
        __len__ in class org.python.core.PyObject
        Returns:
        the length of this mapping.
      • sublist

        protected java.util.List<? extends org.python.core.PyObject> sublist​(int start,
                                                                             int stop)
        Description copied from class: AbstractJythonSequence
        Retrieve a subset of this sequence, from start (inclusive) to stop (exclusive).
        Specified by:
        sublist in class AbstractJythonSequence
        See Also:
        List.subList(int, int)
      • repeat

        protected org.python.core.PyObject repeat​(int count)
                                           throws org.python.core.PyIgnoreMethodTag
        Description copied from class: AbstractJythonSequence
        Implements the repeat operation, which is used by Jython when performing sequence * count, which returns a new list containing sequence * count items. If count is <= 0, returns an empty sequence, ideally of the same type.
        Specified by:
        repeat in class AbstractJythonSequence
        Parameters:
        count - The number of times to repeat the sequence in the output.
        Throws:
        org.python.core.PyIgnoreMethodTag
      • getColumnNames

        public java.util.List<java.lang.String> getColumnNames()
        Description copied from interface: Dataset
        Returns an unmodifiable list of this dataset's column names, in order.
        Specified by:
        getColumnNames in interface Dataset
      • getColumnTypes

        public java.util.List<java.lang.Class<?>> getColumnTypes()
        Description copied from interface: Dataset
        Returns an unmodifiable list of this dataset's column types, in order.
        Specified by:
        getColumnTypes in interface Dataset
      • getColumnCount

        public int getColumnCount()
        Description copied from interface: Dataset
        Returns the number of columns.
        Specified by:
        getColumnCount in interface Dataset
      • getRowCount

        public int getRowCount()
        Description copied from interface: Dataset
        Return the number of rows in this dataset
        Specified by:
        getRowCount in interface Dataset
      • getColumnIndex

        public int getColumnIndex​(java.lang.String name)
        Description copied from interface: Dataset
        Returns the index of the given column, case insensitive
        Specified by:
        getColumnIndex in interface Dataset
        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: Dataset
        Returns the name of the given column.
        Specified by:
        getColumnName in interface Dataset
      • getColumnType

        public java.lang.Class<?> getColumnType​(int col)
        Description copied from interface: Dataset
        Returns the type of the given column.
        Specified by:
        getColumnType in interface Dataset
      • getValueAt

        public java.lang.Object getValueAt​(int row,
                                           int col)
        Description copied from interface: Dataset
        Returns the value in the dataset at the given location.
        Specified by:
        getValueAt in interface Dataset
      • getQualityAt

        public QualityCode getQualityAt​(int row,
                                        int col)
        Description copied from interface: Dataset
        Returns the quality of the value at the given location.
        Specified by:
        getQualityAt in interface Dataset
      • getValueAt

        public java.lang.Object getValueAt​(int row,
                                           java.lang.String colName)
        Description copied from interface: Dataset
        Returns the value at the given row and at a column named colName. Column name matching is case insensitive.
        Specified by:
        getValueAt in interface Dataset
      • getPrimitiveValueAt

        public double getPrimitiveValueAt​(int row,
                                          int col)
        Description copied from interface: Dataset
        If 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:
        getPrimitiveValueAt in interface Dataset
      • binarySearch

        public int binarySearch​(int column,
                                java.lang.Object key)
        Description copied from interface: Dataset
        Performs 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:
        binarySearch in interface Dataset
        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.