NetCharts Pro

netcharts.pro.datamodel
Class NFDataModelTime

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

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

This abstract class should be used to provide an interface for time data 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[Data] and getNumPoints() method calls. An example is shown here:


 Object datao[][] = makeData();

 NFDataModelTime foodata = new NFDataModelTime(datao) {

     public Object getStartDateTime(int row) {
         Object o[][] = (Object[][])dataObject;
         return o[row][0];
     }
     public Object getStopDateTime(int row) {
         Object o[][] = (Object[][])dataObject;
         return o[row][1];
     }
     public Object getTaskText(int row) {
         Object o[][] = (Object[][])dataObject;
         return o[row][2];
     }
     public Object getTaskColor(int row) {
         Object o[][] = (Object[][])dataObject;
         return o[row][3];
     }
     public Object getTaskTextStyle(int row) {
         Object o[][] = (Object[][])dataObject;
         return o[row][4];
     }
     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
NFDataModelTime()
          NFDataModelTime constructor that does not set the underlying data object.
NFDataModelTime(java.lang.Object dataObject)
          NFDataModelTime 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 getNumTasks()
          Return the total number of points available in the data object
abstract  java.lang.Object getStartDateTime(int row)
          Return the task start date/time
abstract  java.lang.Object getStopDateTime(int row)
          Return the task stop date/time
abstract  java.lang.Object getTaskColor(int row)
          Return the task color or null to return the default.
abstract  java.lang.Object getTaskText(int row)
          Return the text to show on the task
abstract  java.lang.Object getTaskTextStyle(int row)
          Return the task color or null to return the default.
 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

NFDataModelTime

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


NFDataModelTime

public NFDataModelTime(java.lang.Object dataObject)
NFDataModelTime 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

getStartDateTime

public abstract java.lang.Object getStartDateTime(int row)
Return the task start date/time


getStopDateTime

public abstract java.lang.Object getStopDateTime(int row)
Return the task stop date/time


getTaskText

public abstract java.lang.Object getTaskText(int row)
Return the text to show on the task


getTaskColor

public abstract java.lang.Object getTaskColor(int row)
Return the task color or null to return the default.


getTaskTextStyle

public abstract java.lang.Object getTaskTextStyle(int row)
Return the task color or null to return the default.


getNumTasks

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


getDataDimensions

public int getDataDimensions()
Return the number of data dimensions

Specified by:
getDataDimensions in interface NFDataModel

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

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