|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.data.DataChoice
ucar.unidata.data.ListDataChoice
ucar.unidata.data.DerivedDataChoice
public class DerivedDataChoice
A subclass of DataChoice for derived quantities.
| Field Summary | |
|---|---|
static String |
PROP_FROMDERIVED
Property indicating this is a derived quantity |
| 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 | |
|---|---|
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,
List dataChoices,
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,
List dataChoices,
String name,
String description,
String categories,
String method,
String formula,
String code)
Used when not creating it from a DerivedDataDescriptor. |
|
DerivedDataChoice(DataContext dataContext,
String formula)
Used when not creating it from a DerivedDataDescriptor. |
|
DerivedDataChoice(DerivedDataChoice that)
The copy ctor. |
|
| Method Summary | |
|---|---|
static String |
cleanupJythonCode(String code)
Clean up any JythonCode that the user inputs |
DataChoice |
cloneMe()
Create a new instance of this object. |
boolean |
equals(Object o)
Override the equals method. |
String |
getCode()
Get the code. |
protected Data |
getData(DataCategory category,
DataSelection incomingDataSelection,
Hashtable requestProperties)
Apply the derived operation. |
DataContext |
getDataContext()
Get the DataContext. |
DerivedDataDescriptor |
getDataDescriptor()
Get the DerivedDataDescriptor. |
String |
getFormula()
Get the formula. |
String |
getFullDescription()
Get the full Description for this DataChoice. |
String |
getMethodName()
Get the method name. |
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(String[] args)
Method for testing. |
static List |
parseOperands(String jythonCode)
Parse out the operands in the given Jython code. |
static List |
parseOperands(String jythonCode,
List operands,
Hashtable seen)
parse the operands in the given jython code |
void |
setClassName(String m)
Stub method to keep around so persistence won't flag a warning. |
void |
setCode(String m)
Set the code. |
void |
setDataContext(DataContext c)
Set the DataContext. |
void |
setDescriptor(DerivedDataDescriptor value)
Set the descriptor. |
void |
setExtraArgs(String foo)
Dummy for persistence. |
void |
setFormula(String formula)
Set the formula. |
void |
setMethodName(String methodName)
Set the method name. |
void |
setUserSelectedChoices(Hashtable value)
Set the user selected choices. |
| Methods inherited from class ucar.unidata.data.ListDataChoice |
|---|
addDataChangeListener, addDataChangeListeners, basicallyEquals, checkCategories, convertLabel, findDataCategories, flushCache, getAllDateTimes, getAllLevels, getChoices, getDataList, getDataSources, getFinalDataChoices, getIndexedName, getSelectedDateTimes, inherit, initAfterUnPersistence, removeDataChangeListener, setChildrenDataChoices, setChoices |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static String PROP_FROMDERIVED
| Constructor Detail |
|---|
public DerivedDataChoice()
public DerivedDataChoice(DerivedDataChoice that)
that - The object to instantiate from.
public DerivedDataChoice(DataContext dataContext,
List dataChoices,
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,
List dataChoices,
String name,
String description,
String categories,
String method,
String formula,
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 DataCategorys.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,
String formula)
dataContext - The context in which this DataChoice exists
(typically the
IntegratedDataViewer).formula - The formula body used as the operator| Method Detail |
|---|
public DataChoice cloneMe()
cloneMe in class ListDataChoicepublic String getFullDescription()
getFullDescription in class ListDataChoice
protected Data getData(DataCategory category,
DataSelection incomingDataSelection,
Hashtable requestProperties)
throws VisADException,
RemoteException,
DataCancelException
getData in class ListDataChoicecategory - Ignore this for now.incomingDataSelection - Allows one to subset the getData call
(e.g., selecting times).requestProperties - extra request properties
Data object that is the result of
applying the operator held by this choice to its set of operands.
DataCancelException - if the request was canelled
RemoteException - Java RMI problem
VisADException - VisAD problempublic void setFormula(String formula)
formula - The new value.public String getFormula()
public String getMethodName()
public void setMethodName(String methodName)
methodName - The new value.public void setClassName(String m)
m - class namepublic String getCode()
public void setCode(String m)
m - The new value.public void setUserSelectedChoices(Hashtable value)
value - a hashtable of choicespublic Hashtable getUserSelectedChoices()
public void setDescriptor(DerivedDataDescriptor value)
value - the new DerivedDataDescriptorpublic DerivedDataDescriptor getDataDescriptor()
public void setExtraArgs(String foo)
foo - extra argspublic int hashCode()
hashCode in class ListDataChoicepublic boolean equals(Object o)
equals in class ListDataChoiceo - Obejct to compare to.
public boolean isEndUserFormula()
isEndUserFormula in class DataChoicepublic static List parseOperands(String jythonCode)
DataOperands
jythonCode - The code.
public static List parseOperands(String jythonCode,
List operands,
Hashtable seen)
jythonCode - jython code to parseoperands - ???seen - operands we have seen so far
public static String cleanupJythonCode(String code)
code - code to clean up
public DataContext getDataContext()
public void setDataContext(DataContext c)
c - The new value.public static void main(String[] args)
args - operands
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||