org.cishell.app.service.datamanager
Interface DataManagerService


public interface DataManagerService

A service for managing loaded Data objects. DataManagerListeners may be registered to be notified of changes in the data manager. Application developers are encouraged to use this service for managing the models they have loaded into memory. Algorithm developers are encouraged not to use this service as it is not guaranteed to be available like the standard CIShell services are.

Author:
Bruce Herr (bh2@bh2.net)

Method Summary
 void addData(Data data)
          Adds a Data object to the manager
 void addDataManagerListener(DataManagerListener listener)
          Adds a DataManagerListener that will be notified as Data objects are added, removed, and selected
 Data[] getAllData()
          Returns all of the Data objects loaded into the manager
 String getLabel(Data data)
          Returns the label for a stored Data object
 Data[] getSelectedData()
          Returns The Data objects that have been selected in the manager
 void removeData(Data data)
          Removes a Data object from the manager
 void removeDataManagerListener(DataManagerListener listener)
          Removes the DataManagerListener from the listener group and will no longer notify it of events
 void setLabel(Data data, String label)
          Set the label to be used for the Data object.
 void setSelectedData(Data[] data)
          Sets which Data objects are selected in the manager.
 

Method Detail

addData

void addData(Data data)
Adds a Data object to the manager

Parameters:
data - The data object

removeData

void removeData(Data data)
Removes a Data object from the manager

Parameters:
data - The data object

setSelectedData

void setSelectedData(Data[] data)
Sets which Data objects are selected in the manager. If a given Data object in the array of Data objects is not in the data manager, then it will be automatically added before selection.

Parameters:
data - The data objects to select

getSelectedData

Data[] getSelectedData()
Returns The Data objects that have been selected in the manager

Returns:
An array of Data objects, length may be zero

getAllData

Data[] getAllData()
Returns all of the Data objects loaded into the manager

Returns:
An array of DataModels, length may be zero

addDataManagerListener

void addDataManagerListener(DataManagerListener listener)
Adds a DataManagerListener that will be notified as Data objects are added, removed, and selected

Parameters:
listener - The listener to be notified of events

removeDataManagerListener

void removeDataManagerListener(DataManagerListener listener)
Removes the DataManagerListener from the listener group and will no longer notify it of events

Parameters:
listener - The listener to be removed

getLabel

String getLabel(Data data)
Returns the label for a stored Data object

Parameters:
data - The Data object
Returns:
A label for the Data object

setLabel

void setLabel(Data data,
              String label)
Set the label to be used for the Data object. The model manager is free to change the label so that it is unique.

Parameters:
data - The Data
label - The new label for the data model