StatBean Name: ProgramDataSource

Purpose: Creates an invisible rectangular data table which may be accessed by other StatBeans. Intended for applications which generate or read their own data without using a StatBean.

Read/Write Properties
NameTypeDescriptionPossible ValuesDefault Value
missingValueCodedoubleA numeric value used to represent missing values in the table.Any numeric value.-32768.0

Other Public Methods
NameDescriptionArgumentsReturn Value
void updateListeners()Informs all listeners that the data has changed.None.None.

Other properties are inherited from the java.awt.Object class and from the general StatDataSource class.

Code Sample

//create the ProgramDataSource bean
ProgramDataSource programDataSource1 = new ProgramDataSource();

//create a bean to display the data
DataDisplayTable dataDisplayTable1 = new DataDisplayTable();

//make the data table a listener for changes in the programDataSource bean
programDataSource1.addDataChangeListener(dataDisplayTable1.listenerForDataChange);

//create a data table with 3 rows and 2 columns
programDataSource1.createDataTable(3,2,-32768.0);

//assign a name and type to each column
programDataSource1.setColumnName(0,"Customer");
programDataSource1.setColumnType(0,'C');
programDataSource1.setColumnName(1,"Orders");
programDataSource1.setColumnType(1,'N');

//fill in the first column
programDataSource1.setStringValue(0,0,"Joe");
programDataSource1.setStringValue(1,0,"Sam");
programDataSource1.setStringValue(2,0,"Mary");

//fill in the second column
programDataSource1.setDoubleValue(0,1,14);
programDataSource1.setDoubleValue(1,1,33);
programDataSource1.setDoubleValue(2,1,27);

//notify all listeners that data has changed
programDataSource1.updateListeners();