NetCharts Pro

netcharts.pro.datamodel
Class NFDataModel2D

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

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

This abstract class should be used to provide an interface for 2 dimensional data sets (x/y sets) from an underlying data object. The underlying data object is passed into the constructor, and then is accessible directly in order to support get[dimension] and getNumPoints() method calls. An example is shown here:


 Object datao[][] = makeData();

 NFDataModel2D foodata = new NFDataModel2D(datao) {
     public Object getX(int row) {
         Object o[][] = (Object[][])dataObject;
         return o[row][0];
     }
     public Object getY(int row) {
         Object o[][] = (Object[][])dataObject;
         return o[row][1];
     }
     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
          Whether or not the model has more data.
 java.lang.Object userData
          Allows for information to be stored within the data model.
 
Constructor Summary
NFDataModel2D()
          NFDataModel2D constructor that does not set the underlying data object.
NFDataModel2D(java.lang.Object dataObject)
          NFDataModel2D constructor that sets the underlying data object.
 
Method Summary
 java.lang.Object elementAt(int rowIndex)
          Used internally
 java.lang.Object elementAt(int row, int col)
          Used internally
 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
abstract  java.lang.Object getX(int row)
          Return the X axis value corresponding to this row.
abstract  java.lang.Object getY(int row)
          Return the Y axis value corresponding to this row.
 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.


hasMoreData

public boolean hasMoreData
Whether or not the model has more data.


userData

public java.lang.Object userData
Allows for information to be stored within the data model.

Constructor Detail

NFDataModel2D

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


NFDataModel2D

public NFDataModel2D(java.lang.Object dataObject)
NFDataModel2D constructor that sets the underlying data object. Used when the implementing class will rely on the underlying data object after initialization to retrieve the values.

Parameters:
dataObject -
Method Detail

getX

public abstract java.lang.Object getX(int row)
Return the X axis value corresponding to this row.


getY

public abstract java.lang.Object getY(int row)
Return the Y axis 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 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