Class DataProviderFactory.HDFDataProvider

Object
hdf.view.TableView.DataProviderFactory.HDFDataProvider
All Implemented Interfaces:
org.eclipse.nebula.widgets.nattable.data.IDataProvider
Enclosing class:
DataProviderFactory

public static class DataProviderFactory.HDFDataProvider extends Object implements org.eclipse.nebula.widgets.nattable.data.IDataProvider
The base DataProvider which pulls data from a given Array object using direct indices.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected long
    the column
    protected Object
    In order to support 3-dimensional datasets, which may need to update the data buffer object after flipping through a 'page', this field is not marked as final.
    protected final boolean
    the type of the parent
    protected final boolean
    if the data is transposed
    protected final boolean
    if the data is in original order
    protected boolean
    if the data value has changed
    protected final Class
    the data format class
    protected final int
    the rank
    protected long
    the row
    protected Object
    the data value
  • Constructor Summary

    Constructors
    Constructor
    Description
    HDFDataProvider(Datatype dtype, Object dataBuf, boolean dataTransposed)
    Create the HDF extended Data Display Provider for the supplied data object
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    getDataValue(int columnIndex, int rowIndex)
     
    getDataValue(Object obj, int index)
    When a parent HDFDataProvider (such as an ArrayDataProvider) wants to retrieve a data value by routing the operation through its base HDFDataProvider, the parent HDFDataProvider will generally know the direct index to have the base provider use.
    getDataValue(Object obj, int columnIndex, int rowIndex)
    When a CompoundDataProvider wants to pass a List of data down to a nested CompoundDataProvider, or when a top-level container DataProvider (such as an ArrayDataProvider) wants to hand data down to a base CompoundDataProvider, we need to pass down a List of data, plus a field and row index.
    final boolean
     
    int
     
    int
    physicalLocationToBufIndex(int rowIndex, int columnIndex)
    A utility method used to translate a set of physical table coordinates to an index into a data buffer.
    void
    setDataValue(int columnIndex, int rowIndex, Object newValue)
    update the data value of a compound type.
    void
    setDataValue(int columnIndex, int rowIndex, Object bufObject, Object newValue)
    When a CompoundDataProvider wants to pass a List of data down to a nested CompoundDataProvider, or when a top-level container DataProvider (such as an ArrayDataProvider) wants to hand data down to a base CompoundDataProvider, we need to pass down a List of data and the new value, plus a field and row index.
    void
    setDataValue(int index, Object bufObject, Object newValue)
    When a parent HDFDataProvider (such as an ArrayDataProvider) wants to set a data value by routing the operation through its base HDFDataProvider, the parent HDFDataProvider will generally know the direct index to have the base provider use.
    final void
    setIsValueChanged(boolean isChanged)
    set if the data value has changed
    final void
    Update the data buffer for this HDFDataProvider.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • dataBuf

      protected Object dataBuf
      In order to support 3-dimensional datasets, which may need to update the data buffer object after flipping through a 'page', this field is not marked as final. However, it is important that subclasses DO NOT override this field.
    • theValue

      protected Object theValue
      the data value
    • originalFormatClass

      protected final Class originalFormatClass
      the data format class
    • isValueChanged

      protected boolean isValueChanged
      if the data value has changed
    • isContainerType

      protected final boolean isContainerType
      the type of the parent
    • rank

      protected final int rank
      the rank
    • isNaturalOrder

      protected final boolean isNaturalOrder
      if the data is in original order
    • isDataTransposed

      protected final boolean isDataTransposed
      if the data is transposed
    • colCount

      protected long colCount
      the column
    • rowCount

      protected long rowCount
      the row
  • Constructor Details

    • HDFDataProvider

      HDFDataProvider(Datatype dtype, Object dataBuf, boolean dataTransposed) throws Exception
      Create the HDF extended Data Display Provider for the supplied data object
      Parameters:
      dtype - the datatype object
      dataBuf - the data buffer to use
      dataTransposed - if the data should be transposed
      Throws:
      Exception - if a failure occurred
  • Method Details

    • physicalLocationToBufIndex

      public int physicalLocationToBufIndex(int rowIndex, int columnIndex)
      A utility method used to translate a set of physical table coordinates to an index into a data buffer.
      Parameters:
      rowIndex - the row
      columnIndex - the column
      Returns:
      physical location in 1D notation
    • getDataValue

      public Object getDataValue(int columnIndex, int rowIndex)
      Specified by:
      getDataValue in interface org.eclipse.nebula.widgets.nattable.data.IDataProvider
    • getDataValue

      public Object getDataValue(Object obj, int columnIndex, int rowIndex)
      When a CompoundDataProvider wants to pass a List of data down to a nested CompoundDataProvider, or when a top-level container DataProvider (such as an ArrayDataProvider) wants to hand data down to a base CompoundDataProvider, we need to pass down a List of data, plus a field and row index. This method is for facilitating this behavior. In general, all "container" DataProviders that have a "container" base DataProvider should call down into their base DataProvider(s) using this method, in order to ensure that buried CompoundDataProviders get handled correctly. When their base DataProvider is not a "container" type, the method getDataValue(Object, index) should be used instead. For atomic type DataProviders, we treat this method as directly calling into getDataValue(Object, index) using the passed rowIndex. However, this method should, in general, not be called by atomic type DataProviders.
      Parameters:
      obj - the data object
      rowIndex - the row
      columnIndex - the column
      Returns:
      value of the data
    • getDataValue

      public Object getDataValue(Object obj, int index)
      When a parent HDFDataProvider (such as an ArrayDataProvider) wants to retrieve a data value by routing the operation through its base HDFDataProvider, the parent HDFDataProvider will generally know the direct index to have the base provider use. This method is to facilitate this kind of behavior. Note that this method takes an Object parameter, which is the object that the method should pull its data from. This is to be able to nicely support nested compound DataProviders.
      Parameters:
      obj - the data object
      index - the index into the data array
      Returns:
      the data object
    • setDataValue

      public void setDataValue(int columnIndex, int rowIndex, Object newValue)
      update the data value of a compound type.
      Specified by:
      setDataValue in interface org.eclipse.nebula.widgets.nattable.data.IDataProvider
      Parameters:
      columnIndex - the column
      rowIndex - the row
      newValue - the new data value object
    • setDataValue

      public void setDataValue(int columnIndex, int rowIndex, Object bufObject, Object newValue)
      When a CompoundDataProvider wants to pass a List of data down to a nested CompoundDataProvider, or when a top-level container DataProvider (such as an ArrayDataProvider) wants to hand data down to a base CompoundDataProvider, we need to pass down a List of data and the new value, plus a field and row index. This method is for facilitating this behavior. In general, all "container" DataProviders that have a "container" base DataProvider should call down into their base DataProvider(s) using this{}, method, in order to ensure that buried CompoundDataProviders get handled correctly. When their base DataProvider is not a "container" type, the method setDataValue(index, Object, Object) should be used instead. For atomic type DataProviders, we treat this method as directly calling into setDataValue(index, Object, Object) using the passed rowIndex. However, this method should, in general, not be called by atomic type DataProviders.
      Parameters:
      columnIndex - the column
      rowIndex - the row
      bufObject - the data object
      newValue - the new data object
    • setDataValue

      public void setDataValue(int index, Object bufObject, Object newValue)
      When a parent HDFDataProvider (such as an ArrayDataProvider) wants to set a data value by routing the operation through its base HDFDataProvider, the parent HDFDataProvider will generally know the direct index to have the base provider use. This method is to facilitate this kind of behavior. Note that this method takes two Object parameters, one which is the object that the method should set its data inside of and one which is the new value to set. This is to be able to nicely support nested compound DataProviders.
      Parameters:
      index - the index into the data array
      bufObject - the data object
      newValue - the new data object
    • getColumnCount

      public int getColumnCount()
      Specified by:
      getColumnCount in interface org.eclipse.nebula.widgets.nattable.data.IDataProvider
    • getRowCount

      public int getRowCount()
      Specified by:
      getRowCount in interface org.eclipse.nebula.widgets.nattable.data.IDataProvider
    • setIsValueChanged

      public final void setIsValueChanged(boolean isChanged)
      set if the data value has changed
      Parameters:
      isChanged - if the data value is changed
    • getIsValueChanged

      public final boolean getIsValueChanged()
      Returns:
      if the datavalue has chaged
    • updateDataBuffer

      public final void updateDataBuffer(Object newBuf)
      Update the data buffer for this HDFDataProvider. This is necessary for when the data that has been read is invalidated, such as when flipping through 'pages' in a > 2-dimensional dataset.
      Parameters:
      newBuf - the new data buffer