Package ucar.unidata.data
Class ListDataChoice
java.lang.Object
ucar.unidata.data.DataChoice
ucar.unidata.data.ListDataChoice
- Direct Known Subclasses:
DerivedDataChoice
A subclass of DataChoice for derived quantities.
- Version:
- $Revision: 1.118 $
- Author:
- IDV Development Team
-
Field Summary
Fields inherited from class ucar.unidata.data.DataChoice
description, id, name, NULL_DATASELECTION, NULL_PROPERTIES, NULL_REQUESTPROPERTIES, parent, PROP_ICON, PROP_REQUESTER, properties -
Constructor Summary
ConstructorsConstructorDescriptionDummy param-less constructor so we can be recreated thru reflection.ListDataChoice(Object id, String name, String description, List categories) The regular constructor from aDerivedDataDescriptorTODO: Right now the children of a ListDataChoice do not refererence their parent.ListDataChoice(String name, List children) ctorListDataChoice(ListDataChoice other) The cloning ctor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDataChangeListener(DataChangeListener listener) Add the data change listener.protected voidaddDataChangeListeners(DataChoice dataChoice) Add the data change listeners to the data choicebooleanbasicallyEquals(DataChoice that) This just checks for basic equality.protected voidThis method runs through the list ofDataCategory-s.cloneMe()Create a new instance of this object.protected StringconvertLabel(String label, List dataChoices) Iterate through the children DataChoice-s.booleanOverride the equals method.protected voidFor now set this object's data categories to be the union of the data categories of its sub-data choices.protected voidRemove any objects created by this choice from the cache.Get the union of all of the childrenDataChoice-s times.getAllLevels(DataSelection dataSelection) Get the union of all of the childrenDataChoice-s levels.Get the children choices.protected DatagetData(DataCategory category, DataSelection dataSelection, Hashtable requestProperties) Get the dataprotected Object[]getDataList(DataCategory category, DataSelection dataSelection, Hashtable requestProperties) Get the array of data from the children data choicesvoidgetDataSources(List dataSources) Add to the given list all the data sourcesvoidgetFinalDataChoices(List finalDataChoices) Add to the given list all final data choices (i.e., the leafs of the datachoice tree)Get the full Description for this DataChoice.getIndexedName(int index) Return the name of the index'th child DataChoice.Get the union of all of the childrenDataChoice-s selected timesinthashCode()Override the hasCode method.protected voidinherit(DataCategory src) This method determines the type of inheritance defined by the given DataCategory.voidinitAfterUnPersistence(Hashtable properties) This gets called after the data choice has been unpersistedvoidremoveDataChangeListener(DataChangeListener listener) Remove the data change listener.voidsetChildrenDataChoices(List dataChoices) set the childrenvoidsetChoices(List l) Set the child DataChoices.Methods inherited from class ucar.unidata.data.DataChoice
addCategory, addCurrentName, addParamNameToCategories, cloneDataChoices, createClone, getAllLevels, getCategories, getCurrentNames, getData, getData, getDataCategories, getDataCategories, getDataSelection, getDescription, getDisplayCategory, getFixedRequestProperties, getForUser, getId, getName, getParent, getProperties, getProperty, getProperty, getProperty, getStringId, isEndUserFormula, mergeRequestProperties, setCategories, setDataCategories, setDataSelection, setDescription, setFixedRequestProperties, setId, setLevelSelection, setName, setObjectProperty, setParent, setProperties, setProperty, setProperty, setTimeSelection, toString
-
Constructor Details
-
ListDataChoice
public ListDataChoice()Dummy param-less constructor so we can be recreated thru reflection. -
ListDataChoice
The cloning ctor.- Parameters:
other- The object to instantiate from.
-
ListDataChoice
The regular constructor from aDerivedDataDescriptorTODO: Right now the children of a ListDataChoice do not refererence their parent. If they do we will need to clone the children here so a DataChoice only has one parent.- Parameters:
id- The idname- namedescription- descriptioncategories- categories
-
ListDataChoice
ctor- Parameters:
name- namechildren- The children data choices
-
-
Method Details
-
setChildrenDataChoices
set the children- Parameters:
dataChoices- the children
-
getData
protected Data getData(DataCategory category, DataSelection dataSelection, Hashtable requestProperties) throws VisADException, RemoteException, DataCancelException Get the data- Specified by:
getDatain classDataChoice- Parameters:
category- categorydataSelection- selectionrequestProperties- properties- Returns:
- This just returns null.
- Throws:
DataCancelException- On badnessRemoteException- On badnessVisADException- On badness
-
getDataList
protected Object[] getDataList(DataCategory category, DataSelection dataSelection, Hashtable requestProperties) throws VisADException, RemoteException, DataCancelException Get the array of data from the children data choices- Parameters:
category- categorydataSelection- selectionrequestProperties- properties- Returns:
- data from children
- Throws:
DataCancelException- On badnessRemoteException- On badnessVisADException- On badness
-
cloneMe
Create a new instance of this object.- Specified by:
cloneMein classDataChoice- Returns:
- The new instance.
-
getIndexedName
Return the name of the index'th child DataChoice.- Overrides:
getIndexedNamein classDataChoice- Parameters:
index- The (0 based) index.- Returns:
- The name of the child DataChoice.
-
checkCategories
protected void checkCategories()This method runs through the list ofDataCategory-s. If any of them are "inherited" categories then we replace the inherited category with the data categories of the children DataChoice-s. -
initAfterUnPersistence
This gets called after the data choice has been unpersisted- Overrides:
initAfterUnPersistencein classDataChoice- Parameters:
properties- Properties
-
getFinalDataChoices
Add to the given list all final data choices (i.e., the leafs of the datachoice tree)- Overrides:
getFinalDataChoicesin classDataChoice- Parameters:
finalDataChoices- The list to add to
-
getDataSources
Add to the given list all the data sources- Overrides:
getDataSourcesin classDataChoice- Parameters:
dataSources- List to put data sources into
-
inherit
This method determines the type of inheritance defined by the given DataCategory. It collects the set of categories from the children DataChoice-s and replaces the given src category with this new set. The different flavors of of inheritance are:- all - take the (set) union of all of the categories of all of the children
- child index - take all of the categories form a particular child DataChoice (e.g., the second child).
- category index - take the index'th data category form each child.
- child invalid input: '&' category index - take the index'th category form a particular child.
- Parameters:
src- TheDataCategoryto look at.
-
convertLabel
Iterate through the children DataChoice-s. For each child n replace within the given label the macro "%Nn%" with the name of the child choice. Replace %Dn" with the child's description.- Parameters:
label- The inital (possibly macro containing) label.dataChoices- The list of childDataChoices.- Returns:
- The instantiated label.
-
getFullDescription
Get the full Description for this DataChoice.- Overrides:
getFullDescriptionin classDataChoice- Returns:
- full description
-
getAllLevels
Get the union of all of the childrenDataChoice-s levels.- Overrides:
getAllLevelsin classDataChoice- Parameters:
dataSelection- data selection- Returns:
- The union of all of the children
DataChoice-s levels.
-
getAllDateTimes
Get the union of all of the childrenDataChoice-s times.- Overrides:
getAllDateTimesin classDataChoice- Returns:
- The union of all of the children
DataChoice-s times.
-
getSelectedDateTimes
Get the union of all of the childrenDataChoice-s selected times- Overrides:
getSelectedDateTimesin classDataChoice- Returns:
- The union of all of the children
DataChoice-s selected times
-
findDataCategories
protected void findDataCategories()For now set this object's data categories to be the union of the data categories of its sub-data choices. -
setChoices
Set the child DataChoices. Mostly used for xml encoding.- Parameters:
l- The list of choices
-
getChoices
Get the children choices. Mostly used for xml encoding.- Returns:
- the list of children
-
flushCache
protected void flushCache()Remove any objects created by this choice from the cache. -
addDataChangeListeners
Add the data change listeners to the data choice- Parameters:
dataChoice- data choice
-
addDataChangeListener
Add the data change listener. This overwrites the base class method to tell each of the children to addDataChangeListener (i.e., the composite pattern).- Specified by:
addDataChangeListenerin classDataChoice- Parameters:
listener- The listener to add.
-
removeDataChangeListener
Remove the data change listener. This overwrites the base class method to tell each of the children to removeDataChangeListener. (i.e., the composite pattern).- Specified by:
removeDataChangeListenerin classDataChoice- Parameters:
listener- The listener to remove.
-
hashCode
public int hashCode()Override the hasCode method.- Overrides:
hashCodein classDataChoice- Returns:
- The object's hashcode.
-
basicallyEquals
This just checks for basic equality. Things like id, datasource, etc.- Overrides:
basicallyEqualsin classDataChoice- Parameters:
that- The object ot check for equality- Returns:
- Is basically equals
-
equals
Override the equals method.- Overrides:
equalsin classDataChoice- Parameters:
o- Obejct to compare to.- Returns:
- Is equals?
-