com.moneydance.awt.graph
Interface GraphDataSource


public interface GraphDataSource

Description: Interface used to access a "data source" object. An object implementing this interface must respond to queries about a range of values. A DataSetType refers to the type of the data set (eg "Category", "Status", or "Type"). The name of the "dataSet" will be some value of the data set type. For instance, if the dataSetType was "Status", possible datasets may include ("Approved", "Pending", or "Rejected"). A single graph could include graphs for each of these datasets on the same graph (i.e. they are graphed relative to each other). A DataSet refers to a set of data that can be graphed and for right now usually has the Date as it's X axis. The data retrieved from a dataSource does not have to be sorted. The DataSet should be able to sort the data, once retrieved.

Author:
Sean D. Reilly

Field Summary
static int ALL
           
static int DAY
           
static int MONTH
           
static int NONE
           
static int WEEK
           
static int YEAR
           
 
Method Summary
 java.lang.String[] getAvailableDataSets(java.lang.String dataSetType)
          Get the list of data sets associated with the specified data set type.
 java.lang.String[] getAvailableDataSetTypes()
          Get a list of "types" of graphs.
 DataSet getDataSetByDateRange(java.lang.String dataSetType, java.lang.String dataSet, java.util.Date date1, java.util.Date date2, java.lang.String valueToGraph)
          Retrieves the data in a date range using the specified data set type, data set, and graph value.
 DataSet getDataSetByDateRange(java.lang.String dataSetType, java.lang.String dataSet, java.util.Date date1, java.util.Date date2, java.lang.String valueToGraph, int groupBy)
          Retrieves the data in a date range using the specified data set type, data set, graph value, and grouping.
 java.text.SimpleDateFormat getDefaultDateFormat()
          Get the date format that should be used to draw dates.
 java.lang.String[] getPossibleGraphValues()
          Get the list of possible "values" to graph.
 

Field Detail

DAY

public static final int DAY
See Also:
Constant Field Values

WEEK

public static final int WEEK
See Also:
Constant Field Values

MONTH

public static final int MONTH
See Also:
Constant Field Values

YEAR

public static final int YEAR
See Also:
Constant Field Values

ALL

public static final int ALL
See Also:
Constant Field Values

NONE

public static final int NONE
See Also:
Constant Field Values
Method Detail

getDefaultDateFormat

public java.text.SimpleDateFormat getDefaultDateFormat()
Get the date format that should be used to draw dates.


getAvailableDataSetTypes

public java.lang.String[] getAvailableDataSetTypes()
Get a list of "types" of graphs. For example "Spending by category", or "Income by source". This is very context specific.


getAvailableDataSets

public java.lang.String[] getAvailableDataSets(java.lang.String dataSetType)
Get the list of data sets associated with the specified data set type. For example, if the data set type is "Spending by category", the available data sets could include "Groceries", "Phone Bill", "Auto Fuel", etc.


getPossibleGraphValues

public java.lang.String[] getPossibleGraphValues()
Get the list of possible "values" to graph. For example possible values could be "Average Amount", "Maximum Amount", "Median Amount", etc. This basically just indicates how the data values will be grouped.


getDataSetByDateRange

public DataSet getDataSetByDateRange(java.lang.String dataSetType,
                                     java.lang.String dataSet,
                                     java.util.Date date1,
                                     java.util.Date date2,
                                     java.lang.String valueToGraph)
Retrieves the data in a date range using the specified data set type, data set, and graph value.


getDataSetByDateRange

public DataSet getDataSetByDateRange(java.lang.String dataSetType,
                                     java.lang.String dataSet,
                                     java.util.Date date1,
                                     java.util.Date date2,
                                     java.lang.String valueToGraph,
                                     int groupBy)
Retrieves the data in a date range using the specified data set type, data set, graph value, and grouping. The grouping may be DAY, WEEK, MONTH, YEAR, ALL, NONE. ALL means: lump all the data into one data item. NONE means: don't group any data items together. DAY, WEEK, MONTH, and YEAR indicate that the data should be grouped by the day, week, month, or year, respectively.