public abstract class DataChoice
extends java.lang.Object
DataCategory
s that
represent the flavor or flavors of data provided by this DataChoice.Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
description
Long descriptive name (e.g, "isobaric temperature", "u component
of wind", etc.)
|
protected java.lang.Object |
id
The identifying object.
|
protected java.lang.String |
name
Short descriptive name (e.g., T, U, etc.).
|
static DataSelection |
NULL_DATASELECTION
A
null DataSelection |
static java.util.Hashtable |
NULL_PROPERTIES
A
null properties intrinsic |
static java.util.Hashtable |
NULL_REQUESTPROPERTIES
The
null request properties intrinsic |
protected DataChoice |
parent
DataChoice-s can follow a composite pattern.
|
static java.lang.String |
PROP_ICON
The icon property
|
static java.lang.String |
PROP_REQUESTER
The requester property
|
protected java.util.Hashtable |
properties
A general properties table.
|
Constructor and Description |
---|
DataChoice()
The bean constructor.
|
DataChoice(DataChoice other)
Create a new DataChoice, using the state of the given DataChoice to
initialize the new object.
|
DataChoice(java.lang.Object id,
java.lang.String description)
Create a new DataChoice.
|
DataChoice(java.lang.Object id,
java.lang.String description,
DataCategory category)
Create a new DataChoice.
|
DataChoice(java.lang.Object id,
java.lang.String description,
java.util.List categories)
Create a new DataChoice.
|
DataChoice(java.lang.Object id,
java.lang.String name,
java.lang.String description,
java.util.List categories)
Create a new DataChoice.
|
DataChoice(java.lang.Object id,
java.lang.String name,
java.lang.String description,
java.util.List categories,
java.util.Hashtable properties)
Create a new DataChoice.
|
Modifier and Type | Method and Description |
---|---|
void |
addCategory(DataCategory newCategory)
Add the given
DataCategory into the list of data categories. |
static void |
addCurrentName(java.lang.Object name)
This adds into a globallist the given param name
|
abstract void |
addDataChangeListener(DataChangeListener listener)
Add the
DataChangeListener . |
protected void |
addParamNameToCategories()
Add the DataCategory "param:" and
"param:
|
boolean |
basicallyEquals(DataChoice that)
This just checks for basic equality.
|
static java.util.List |
cloneDataChoices(java.util.List listOfChoices)
Utility method to clone and return a list of DataChoice-s.
|
abstract DataChoice |
cloneMe()
Create a new instance of this DataChoice.
|
DataChoice |
createClone()
Create a new instance of this DataChoice.
|
boolean |
equals(java.lang.Object other)
Check for equality of this object to another
|
java.util.List |
getAllDateTimes()
Get all the times associated with this choice
|
java.util.List |
getAllLevels()
Get all the levels associated with this choice
|
java.util.List |
getAllLevels(DataSelection dataSelection)
Get all the levels associated with this choice
|
java.util.List |
getCategories()
Get the list of
DataCategory s that this DataChoice represents. |
static java.util.List |
getCurrentNames()
Get the list of all data choice names there ever was during the run
|
protected abstract visad.Data |
getData(DataCategory category,
DataSelection dataSelection,
java.util.Hashtable requestProperties)
Return the
Data object that this DataChoice represents. |
visad.Data |
getData(DataSelection incomingDataSelection)
Return the
Data object that this DataChoice represents. |
visad.Data |
getData(DataSelection incomingDataSelection,
java.util.Hashtable requestProperties)
Return the
Data object that this DataChoice represents. |
java.util.List |
getDataCategories()
Deprecated.
|
java.util.List |
getDataCategories(boolean excludeDisplayCategories)
Get the list of DataCategory-s but exclude any that are used for display
if excludeDisplayCategories is true
|
DataSelection |
getDataSelection()
Get the data selection for this choice
|
void |
getDataSources(java.util.List dataSources)
Add to the given list all the data sources
|
java.lang.String |
getDescription()
Return the human readable description.
|
DataCategory |
getDisplayCategory()
Return the
DataCategory that is meant to be used for displaying
this DataChoice within a UI. |
void |
getFinalDataChoices(java.util.List dataChoices)
Add to the given list all final data choices (i.e.,
the leafs of the datachoice tree)
|
java.util.Hashtable |
getFixedRequestProperties()
Get the FixedRequestProperties property.
|
boolean |
getForUser()
A DataChoice can be not intended to be shown to the user within a UI.
|
java.lang.String |
getFullDescription()
This method is used to get a lengthy description of this DataChoice.
|
java.lang.Object |
getId()
Return the identifying object.
|
java.lang.String |
getIndexedName(int index)
Return the indexed name, the default is to simply return the name.
|
java.lang.String |
getName()
Return the name of this DataChoice.
|
DataChoice |
getParent()
Return the parent of this DataChoice (may be, and usually is, null).
|
java.util.Hashtable |
getProperties()
Getter method for the properties hashtable.
|
java.lang.Object |
getProperty(java.lang.String name)
Return the property, if not found return the null.
|
boolean |
getProperty(java.lang.String name,
boolean dflt)
Return the boolean property, if not found return the dflt.
|
java.lang.String |
getProperty(java.lang.String name,
java.lang.String dflt)
Return the String property, if not found return the dflt.
|
java.util.List |
getSelectedDateTimes()
Get the List of selected times (sub selection of all times).
|
java.lang.String |
getStringId()
Return the toString() value of the id.
|
int |
hashCode()
Override the hashCodes method.
|
void |
initAfterUnPersistence(java.util.Hashtable properties)
This gets called after the data choice has been unpersisted
|
boolean |
isEndUserFormula()
Top-level method to determine if this object is an end-user formula.
|
static java.util.Hashtable |
mergeRequestProperties(java.util.Hashtable incoming,
java.util.Hashtable fixedRequestProperties)
Merge the given incoming request properties with the ones held by this data choice.
|
abstract void |
removeDataChangeListener(DataChangeListener listener)
Remove the
DataChangeListener . |
void |
setCategories(java.util.List categories)
Set the list of
DataCategory s that this DataChoice represents. |
void |
setDataCategories(java.util.List categories)
Deprecated.
Does nothing now.
|
void |
setDataSelection(DataSelection dataSelection)
Set the data time selection for this choice
|
void |
setDescription(java.lang.String desc)
Set the human readable description.
|
void |
setFixedRequestProperties(java.util.Hashtable value)
Set the FixedRequestProperties property.
|
void |
setId(java.lang.Object theId)
DataChoices typically have some identifying Object associated with
them (e.g., a time, a field name, etc.)
|
void |
setLevelSelection(visad.Real level)
Set the level
|
void |
setName(java.lang.String newName)
Set the name of this DataChoice.
|
void |
setObjectProperty(java.lang.String name,
java.lang.Object propertyValue)
Set the String property.
|
void |
setParent(DataChoice parent)
Set the parent of this DataChoice.
|
void |
setProperties(java.util.Hashtable newProperties)
Setter method for the properties hashtable.
|
void |
setProperty(java.lang.String name,
boolean propertyValue)
Set the boolean property.
|
void |
setProperty(java.lang.String name,
java.lang.String propertyValue)
Set the property.
|
void |
setTimeSelection(java.util.List times)
Set the time selection for this choice
|
java.lang.String |
toString()
Return the description.
|
public static final DataSelection NULL_DATASELECTION
null
DataSelection
public static final java.util.Hashtable NULL_PROPERTIES
null
properties intrinsicpublic static final java.lang.String PROP_REQUESTER
public static final java.lang.String PROP_ICON
public static final java.util.Hashtable NULL_REQUESTPROPERTIES
null
request properties intrinsicprotected java.util.Hashtable properties
protected DataChoice parent
protected java.lang.Object id
protected java.lang.String name
protected java.lang.String description
public DataChoice()
public DataChoice(DataChoice other)
other
- The other data choice.public DataChoice(java.lang.Object id, java.lang.String name, java.lang.String description, java.util.List categories)
id
- The identifying object.name
- The short name of this choice.description
- The long description of this choice.categories
- List of DataCategory
s.public DataChoice(java.lang.Object id, java.lang.String name, java.lang.String description, java.util.List categories, java.util.Hashtable properties)
id
- The identifying object.name
- The short name of this choice.description
- The long description of this choice.categories
- List of DataCategory
s.properties
- The properties for this data choice (may be null).public DataChoice(java.lang.Object id, java.lang.String description)
id
- The identifying object.description
- The long description of this choice.public DataChoice(java.lang.Object id, java.lang.String description, java.util.List categories)
id
- The identifying object.description
- The long description of this choice.categories
- List of DataCategory
s.public DataChoice(java.lang.Object id, java.lang.String description, DataCategory category)
id
- The identifying object.description
- The long description of this choice.category
- The DataCategory.public static void addCurrentName(java.lang.Object name)
name
- param name to addpublic static java.util.List getCurrentNames()
public void initAfterUnPersistence(java.util.Hashtable properties)
properties
- Propertiespublic void getFinalDataChoices(java.util.List dataChoices)
dataChoices
- List to put data choices intopublic void getDataSources(java.util.List dataSources)
dataSources
- List to put data sources intoprotected void addParamNameToCategories()
public void setDataSelection(DataSelection dataSelection)
dataSelection
- The data Selectionpublic DataSelection getDataSelection()
public void setTimeSelection(java.util.List times)
times
- List of timespublic void setLevelSelection(visad.Real level)
level
- The levelpublic java.util.List getAllLevels()
public java.util.List getAllLevels(DataSelection dataSelection)
dataSelection
- data selectionpublic java.util.List getAllDateTimes()
public java.util.List getSelectedDateTimes()
public static java.util.List cloneDataChoices(java.util.List listOfChoices)
listOfChoices
- The source list of choices.public final DataChoice createClone()
public abstract DataChoice cloneMe()
public DataChoice getParent()
public void setParent(DataChoice parent)
parent
- The new parent of this data choice.public boolean getForUser()
public DataCategory getDisplayCategory()
DataCategory
that is meant to be used for displaying
this DataChoice within a UI. For now just return the first category
this is "forDisplay".public void addCategory(DataCategory newCategory)
DataCategory
into the list of data categories.newCategory
- The new DataCategory
public java.util.List getCategories()
DataCategory
s that this DataChoice represents.public java.util.List getDataCategories()
public java.util.List getDataCategories(boolean excludeDisplayCategories)
excludeDisplayCategories
- if true then only return the data categories that are not
display categoriespublic void setDataCategories(java.util.List categories)
categories
- The list of data categories.public void setCategories(java.util.List categories)
DataCategory
s that this DataChoice represents.categories
- The list of data categories.public final visad.Data getData(DataSelection incomingDataSelection) throws visad.VisADException, java.rmi.RemoteException, DataCancelException
Data
object that this DataChoice represents.
Merge this object's DataSelection
with the argument
DataSelection (which has higher priority).incomingDataSelection
- Allows one to subset the request.DataCancelException
- if the request to get data is canceledjava.rmi.RemoteException
- problem accessing remote datavisad.VisADException
- problem creating the Data objectpublic final visad.Data getData(DataSelection incomingDataSelection, java.util.Hashtable requestProperties) throws visad.VisADException, java.rmi.RemoteException, DataCancelException
Data
object that this DataChoice represents.
Merge this object's DataSelection
with the argument
DataSelection (which has higher priority).incomingDataSelection
- Allows one to subset the request.requestProperties
- The object requesting this data.DataCancelException
- if the request to get data is canceledjava.rmi.RemoteException
- problem accessing remote datavisad.VisADException
- problem creating the Data objectprotected abstract visad.Data getData(DataCategory category, DataSelection dataSelection, java.util.Hashtable requestProperties) throws visad.VisADException, java.rmi.RemoteException, DataCancelException
Data
object that this DataChoice represents.category
- The DataCategory
used to subset this
call (usually not used but placed in here
just in case it is needed.)dataSelection
- Allows one to subset the data request (e.g.,
asking for a smaller set of times, etc.)requestProperties
- Extra selection propertiesDataCancelException
- if the request to get data is canceledjava.rmi.RemoteException
- problem accessing remote datavisad.VisADException
- problem creating the Data objectpublic static java.util.Hashtable mergeRequestProperties(java.util.Hashtable incoming, java.util.Hashtable fixedRequestProperties)
incoming
- Incoming choicesfixedRequestProperties
- The lower priority hashtablepublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- Object to check equality.public boolean basicallyEquals(DataChoice that)
that
- The object ot check for equalitypublic java.lang.String getStringId()
public java.lang.String getIndexedName(int index)
DerivedDataChoice
uses this to return
the name of the index'th operand.index
- The (0 based) index.public java.lang.String getName()
public void setName(java.lang.String newName)
newName
- The new name.public java.lang.String getDescription()
public void setDescription(java.lang.String desc)
desc
- The new description.public java.lang.String getFullDescription()
public void setId(java.lang.Object theId)
theId
- The identifying Object.public java.lang.Object getId()
public java.lang.String toString()
toString
in class java.lang.Object
public void setProperty(java.lang.String name, boolean propertyValue)
name
- Property name.propertyValue
- boolean property valuepublic void setObjectProperty(java.lang.String name, java.lang.Object propertyValue)
name
- Property name.propertyValue
- String property valuepublic void setProperty(java.lang.String name, java.lang.String propertyValue)
name
- Property name.propertyValue
- String property valuepublic boolean getProperty(java.lang.String name, boolean dflt)
name
- Property name.dflt
- The default value.public java.lang.String getProperty(java.lang.String name, java.lang.String dflt)
name
- Property name.dflt
- The default value.public java.lang.Object getProperty(java.lang.String name)
name
- Property name.public java.util.Hashtable getProperties()
public void setProperties(java.util.Hashtable newProperties)
newProperties
- The new Properties table.public abstract void addDataChangeListener(DataChangeListener listener)
DataChangeListener
. This is the object that is notify
when the data that this DataChoice represents has changed. This is an
abstract method, the derived classes override it. e.g., the
DerivedDataChoice
tells simply passes the listener on to
its set of children DataChoices.listener
- The DataChangeListener
to add.public abstract void removeDataChangeListener(DataChangeListener listener)
DataChangeListener
.listener
- The DataChangeListener
to remove.public boolean isEndUserFormula()
DerivedDataChoice
created through the formulas
framework.public void setFixedRequestProperties(java.util.Hashtable value)
value
- The new value for FixedRequestPropertiespublic java.util.Hashtable getFixedRequestProperties()