NetCharts Pro

netcharts.pro.datamodel
Class NFDataModel1D

java.lang.Object
  extended by netcharts.pro.datamodel.NFDataModel1D
All Implemented Interfaces:
NFDataModel

public abstract class NFDataModel1D
extends java.lang.Object
implements NFDataModel

This abstract class should be used to provide an interface for 1 dimensional data sets (bar sets, line sets, etc) from an underlying data object. The underlying data object is passed into the constructor, and then is accessible directly in order to support getData and getNumPoints() method calls. An example is shown here:


 Object datao[][] = makeData();

 NFDataModel1D foodata = new NFDataModel1D(datao) {
     public Object getData(int row) {
         Object o[][] = (Object[][])dataObject;
         return o[row][2];
     }
     public int getNumPoints() {
         return ((Object[])dataObject).length;
     }
 };
 
In the example above, the underlying data object is a multidimensional object array, but it could be a JDBC result set, DOM object, or other data object. This data may be passed to any instance of NFVector via the loadDataModel call.


Field Summary
 java.lang.Object dataObject
          Constructor provided data object.
 boolean hasMoreData
          When true, data model is assumed to contain more data.
 java.lang.Object userData
          Extra pointer to be used at the developer's discretion.
 
Constructor Summary
NFDataModel1D()
          NFDataModel1D constructor that does not set the underlying data object.
NFDataModel1D(java.lang.Object dataObject)
          Constructs a one dimensional data model using the passed in dataObject pointer.
 
Method Summary
 java.lang.Object elementAt(int rowIndex)
          Used internally
 java.lang.Object elementAt(int row, int col)
          Used internally
abstract  java.lang.Object getData(int row)
          Return the data value corresponding to this row.
 int getDataDimensions()
          Return the number of data dimensions
 int getNRows()
          Used internally
abstract  int getNumPoints()
          Return the total number of points available in the data object
 boolean hasMoreData()
          Returns whether or not there is more data.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataObject

public java.lang.Object dataObject
Constructor provided data object.


userData

public java.lang.Object userData
Extra pointer to be used at the developer's discretion. Not used internally.


hasMoreData

public boolean hasMoreData
When true, data model is assumed to contain more data.

Constructor Detail

NFDataModel1D

public NFDataModel1D()
NFDataModel1D constructor that does not set the underlying data object. Used when the implementing class will not rely on the underlying data object after initialization.


NFDataModel1D

public NFDataModel1D(java.lang.Object dataObject)
Constructs a one dimensional data model using the passed in dataObject pointer. This dataObject may be any data source including a JDBC result set, two dimensional object array, and more. The dataObject is set to the public dataObject variable which can be used in the getData and getNumPoint method calls.

Parameters:
dataObject -
Method Detail

getData

public abstract java.lang.Object getData(int row)
Return the data value corresponding to this row.


getNumPoints

public abstract int getNumPoints()
Return the total number of points available in the data object


hasMoreData

public boolean hasMoreData()
Returns whether or not there is more data. This is necessary where the number of rows being returned does not correspond to the underlying data set.

Specified by:
hasMoreData in interface NFDataModel

getDataDimensions

public final int getDataDimensions()
Return the number of data dimensions

Specified by:
getDataDimensions in interface NFDataModel

elementAt

public final java.lang.Object elementAt(int rowIndex)
Used internally

Specified by:
elementAt in interface NFDataModel

elementAt

public final java.lang.Object elementAt(int row,
                                        int col)
Used internally

Specified by:
elementAt in interface NFDataModel

getNRows

public final int getNRows()
Used internally

Specified by:
getNRows in interface NFDataModel

NetCharts Pro


Visual Mining, Inc.
2099 Gaither Rd.
Suite 220
Rockville, MD 20850
800.308.0731
301.947.8293 FAX

Copyright © Visual Mining, Inc. 1996 - 2011
All Rights Reserved.

NetCharts Pro TM is a registered trademark of Visual Mining, Inc. Other brands and their products are trademarks of their respective holders.

Last Modified: Jun 28, 2011