public class DerivedDataChoice extends ListDataChoice
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROP_FROMDERIVED
Property indicating this is a derived quantity
|
description, id, name, NULL_DATASELECTION, NULL_PROPERTIES, NULL_REQUESTPROPERTIES, parent, PROP_ICON, PROP_REQUESTER, properties
Constructor and Description |
---|
DerivedDataChoice()
Dummy param-less constructor so we can be recreated thru reflection.
|
DerivedDataChoice(DataContext dataContext,
DerivedDataDescriptor ddd)
This is the constructor used when creating a DDC as an end user formula.
|
DerivedDataChoice(DataContext dataContext,
java.util.List dataChoices,
java.lang.String desc,
DerivedDataDescriptor ddd)
The regular constructor from a
DerivedDataDescriptor
TODO: Right now the children of a DerivedDataChoice do not refererence
their parent. |
DerivedDataChoice(DataContext dataContext,
java.util.List dataChoices,
java.lang.String name,
java.lang.String description,
java.lang.String categories,
java.lang.String method,
java.lang.String formula,
java.lang.String code)
Used when not creating it from a DerivedDataDescriptor.
|
DerivedDataChoice(DataContext dataContext,
java.lang.String formula)
Used when not creating it from a DerivedDataDescriptor.
|
DerivedDataChoice(DerivedDataChoice that)
The copy ctor.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
cleanupJythonCode(java.lang.String code)
Clean up any JythonCode that the user inputs
|
DataChoice |
cloneMe()
Create a new instance of this object.
|
boolean |
equals(java.lang.Object o)
Override the equals method.
|
java.lang.String |
getCode()
Get the code.
|
protected visad.Data |
getData(DataCategory category,
DataSelection incomingDataSelection,
java.util.Hashtable requestProperties)
Apply the derived operation.
|
DataContext |
getDataContext()
Get the DataContext.
|
DerivedDataDescriptor |
getDataDescriptor()
Get the DerivedDataDescriptor.
|
java.lang.String |
getFormula()
Get the formula.
|
java.lang.String |
getFullDescription()
Get the full Description for this DataChoice.
|
java.lang.String |
getMethodName()
Get the method name.
|
java.util.Hashtable |
getUserSelectedChoices()
Get the user selected choices.
|
int |
hashCode()
Override the hasCode method.
|
boolean |
isEndUserFormula()
Is this an (editable) end user formula.
|
static void |
main(java.lang.String[] args)
Method for testing.
|
static java.util.List |
parseOperands(java.lang.String jythonCode)
Parse out the operands in the given Jython code.
|
static java.util.List |
parseOperands(java.lang.String jythonCode,
java.util.List operands,
java.util.Hashtable seen)
parse the operands in the given jython code
|
void |
setClassName(java.lang.String m)
Stub method to keep around so persistence won't flag a warning.
|
void |
setCode(java.lang.String m)
Set the code.
|
void |
setDataContext(DataContext c)
Set the DataContext.
|
void |
setDescriptor(DerivedDataDescriptor value)
Set the descriptor.
|
void |
setExtraArgs(java.lang.String foo)
Dummy for persistence.
|
void |
setFormula(java.lang.String formula)
Set the formula.
|
void |
setMethodName(java.lang.String methodName)
Set the method name.
|
void |
setUserSelectedChoices(java.util.Hashtable value)
Set the user selected choices.
|
addDataChangeListener, addDataChangeListeners, basicallyEquals, checkCategories, convertLabel, findDataCategories, flushCache, getAllDateTimes, getAllLevels, getChoices, getDataList, getDataSources, getFinalDataChoices, getIndexedName, getSelectedDateTimes, inherit, initAfterUnPersistence, removeDataChangeListener, setChildrenDataChoices, setChoices
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, mergeRequestProperties, setCategories, setDataCategories, setDataSelection, setDescription, setFixedRequestProperties, setId, setLevelSelection, setName, setObjectProperty, setParent, setProperties, setProperty, setProperty, setTimeSelection, toString
public static java.lang.String PROP_FROMDERIVED
public DerivedDataChoice()
public DerivedDataChoice(DerivedDataChoice that)
that
- The object to instantiate from.public DerivedDataChoice(DataContext dataContext, java.util.List dataChoices, java.lang.String desc, DerivedDataDescriptor ddd)
DerivedDataDescriptor
TODO: Right now the children of a DerivedDataChoice do not refererence
their parent. If they do we will need to clone the children here
so a DataChoice only has one parent.dataContext
- The context in which this DataChoice exists
(typically the
IntegratedDataViewer
).dataChoices
- The list of initial children data choices
(the operands).desc
- The long description of this choice.ddd
- The DerivedDataDescriptor
that holds
the information to instantiate this choice.public DerivedDataChoice(DataContext dataContext, DerivedDataDescriptor ddd)
dataContext
- The context in which this DataChoice exists
(typically the
IntegratedDataViewer
).ddd
- The DerivedDataDescriptor
that holds
the information to instantiate this choice.public DerivedDataChoice(DataContext dataContext, java.util.List dataChoices, java.lang.String name, java.lang.String description, java.lang.String categories, java.lang.String method, java.lang.String formula, java.lang.String code)
dataContext
- The context in which this DataChoice exists
(typically the
IntegratedDataViewer
).dataChoices
- The list of initial children data choices
(the operands).name
- The name of this DataChoice.description
- The description of this DataChoice.categories
- The list if DataCategory
s.method
- The method name used as the operator
(may be null).formula
- The formula body used as the operator
(may be null).code
- The code body used as the operator (may be
null). (Note: having different code and
formula attributes is just a hangover from the
initial development. They are acted upon in
the same way.public DerivedDataChoice(DataContext dataContext, java.lang.String formula)
dataContext
- The context in which this DataChoice exists
(typically the
IntegratedDataViewer
).formula
- The formula body used as the operatorpublic DataChoice cloneMe()
cloneMe
in class ListDataChoice
public java.lang.String getFullDescription()
getFullDescription
in class ListDataChoice
protected visad.Data getData(DataCategory category, DataSelection incomingDataSelection, java.util.Hashtable requestProperties) throws visad.VisADException, java.rmi.RemoteException, DataCancelException
getData
in class ListDataChoice
category
- Ignore this for now.incomingDataSelection
- Allows one to subset the getData call
(e.g., selecting times).requestProperties
- extra request propertiesData
object that is the result of
applying the operator held by this choice to its set of operands.DataCancelException
- if the request was canelledjava.rmi.RemoteException
- Java RMI problemvisad.VisADException
- VisAD problempublic void setFormula(java.lang.String formula)
formula
- The new value.public java.lang.String getFormula()
public java.lang.String getMethodName()
public void setMethodName(java.lang.String methodName)
methodName
- The new value.public void setClassName(java.lang.String m)
m
- class namepublic java.lang.String getCode()
public void setCode(java.lang.String m)
m
- The new value.public void setUserSelectedChoices(java.util.Hashtable value)
value
- a hashtable of choicespublic java.util.Hashtable getUserSelectedChoices()
public void setDescriptor(DerivedDataDescriptor value)
value
- the new DerivedDataDescriptorpublic DerivedDataDescriptor getDataDescriptor()
public void setExtraArgs(java.lang.String foo)
foo
- extra argspublic int hashCode()
hashCode
in class ListDataChoice
public boolean equals(java.lang.Object o)
equals
in class ListDataChoice
o
- Obejct to compare to.public boolean isEndUserFormula()
isEndUserFormula
in class DataChoice
public static java.util.List parseOperands(java.lang.String jythonCode)
DataOperand
sjythonCode
- The code.public static java.util.List parseOperands(java.lang.String jythonCode, java.util.List operands, java.util.Hashtable seen)
jythonCode
- jython code to parseoperands
- ???seen
- operands we have seen so farpublic static java.lang.String cleanupJythonCode(java.lang.String code)
code
- code to clean uppublic DataContext getDataContext()
public void setDataContext(DataContext c)
c
- The new value.public static void main(java.lang.String[] args)
args
- operands