|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.data.DerivedDataDescriptor
public class DerivedDataDescriptor
This class is used to hold the descriptions of possible
DerivedDataChoice-s that are specified in the derived.xml
resource file.
| Field Summary | |
|---|---|
static List |
classes
A list of String names of full class names taken from the derived.xml <class> tags. |
static String |
NULL_STRING
NULL string identifier |
| Constructor Summary | |
|---|---|
DerivedDataDescriptor()
Dummy constructor for now |
|
DerivedDataDescriptor(ArrayList needs,
String id,
String description,
ArrayList categories,
String method,
String formula,
String code,
Properties properties)
Constructor for the descriptor. |
|
DerivedDataDescriptor(DataContext dataContext)
Constructor used for when we create an end-user formula |
|
DerivedDataDescriptor(DataContext dataContext,
String id,
String desc,
String formula,
List categories)
ctor |
|
DerivedDataDescriptor(DerivedDataDescriptor other)
Copy constructor. |
|
| Method Summary | |
|---|---|
static void |
addToChoicesSoFar(Hashtable choicesSoFar,
DataChoice dataChoice)
Add the given data choice into the Hashtable of choicesSoFar. |
void |
clearAfterSearch()
Called by the DerivedDataChoice.getDerivedDataChoices method after the search for the set of possible DerivedDataChoice-s are created. |
boolean |
equals(Object other)
Check to see if the Object is equal to this one. |
List |
getDataCategories()
Return the list of DataCategorys |
DerivedDataChoice |
getDataChoice()
This creates a new DerivedDataChoice whose state is defined by this DerivedDataDescriptor |
NamedList |
getDataChoices(Hashtable choicesSoFar)
If the choicesSoFar map contains each parameter in any of the parameter groups return a NamedList holding the label to be used and the collection of dataChoices that correspond to the required parameters. |
DataContext |
getDataContext()
Get the DataContext for this descriptor |
static List |
getDerivedDataChoices(DataContext context,
List sourceChoices,
List descriptors)
Search through and return a list of DerivedDataChoices that can be created from the given list of sourceChoices. |
String |
getDescription()
Get the description for this descriptor |
DataCategory |
getDisplayCategory()
Return the first DataCategory in the list of categories
that is for display purposes. |
String |
getFormula()
Get the formula for this derived quantity |
String |
getId()
Get the id for this descriptor. |
boolean |
getIsDefault()
Get whether this is a default derived quantity. |
boolean |
getIsEndUser()
Get whether this is an end user derived quantity |
boolean |
getIsLocalUsers()
Get whether this is a formula the user has edited |
String |
getJythonProcedure()
Get the Jython procedure for this derived data |
String |
getJythonProcedure(String procname)
Get the Jython procedure for the specified procedure name |
List |
getNeeds()
Get list of DerivedNeed-s |
String |
getOperandsCategories()
Get the OperandsCategories property. |
protected List |
getOperandsCategoryList()
get categories for operands |
static List |
init(DataContext dataContext,
XmlResourceCollection xrc)
Go through each xml file defined by the given XmlResourceCollection and create the DerivedDataDescriptor-s defined in the xml. |
void |
initForSearch()
Called by the DerivedDataChoice.getDerivedDataChoices method before the search for the set of possible DerivedDataChoice-s are created. |
static void |
main(String[] args)
Method to test |
static List |
readClasses(Element root)
Read in the java classes defined in any class tags under the root. |
static List |
readDescriptors(DataContext dataContext,
Element root,
boolean isLocal)
Create and return a list of the DDDs that are defined by the given xml root Element. |
void |
setDataCategories(List categories)
Mostly used by the IntegratedDataViewer FormulaDialog when creating an end-user formula. |
void |
setDataContext(DataContext value)
Set the DataContext for this descriptor |
void |
setDescription(String value)
Set the description for this descriptor |
void |
setFormula(String value)
Set the formula for this derived quantity |
void |
setId(String value)
Set the id for this descriptor. |
void |
setIsDefault(boolean value)
Set whether this is a default derived quantity. |
void |
setIsEndUser(boolean value)
Set whether this is an end user derived quantity (ie, formula). |
void |
setIsLocalUsers(boolean value)
Set whether this is a formula the user has edited |
void |
setNeeds(List<DerivedNeed> needs)
Set the needs list |
void |
setOperandsCategories(String value)
Set the OperandsCategories property. |
String |
toString()
Return a string representation of this DerivedDataDescriptor. |
Element |
toXml(Document doc)
Return the XML Element that represents this DerivedDataDescriptor |
static String |
toXml(List descriptors)
Create the xml representation (the derived.xml) of the given list of DerivedDataDescriptors. |
void |
updateDataGroups()
Update derived needs when the DataGroups change |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String NULL_STRING
public static List classes
| Constructor Detail |
|---|
public DerivedDataDescriptor()
public DerivedDataDescriptor(DataContext dataContext,
String id,
String desc,
String formula,
List categories)
dataContext - context for this descriptorid - The iddesc - descriptionformula - formulacategories - List of data categoriespublic DerivedDataDescriptor(DataContext dataContext)
dataContext - context for this descriptor
public DerivedDataDescriptor(ArrayList needs,
String id,
String description,
ArrayList categories,
String method,
String formula,
String code,
Properties properties)
needs - list of operands neededid - identifierdescription - long namecategories - list of categoriesmethod - method (may be null)formula - formula (may be null)code - jython code (may be null)properties - extra propertiespublic DerivedDataDescriptor(DerivedDataDescriptor other)
other - other instance to copy.| Method Detail |
|---|
protected List getOperandsCategoryList()
public List getNeeds()
public void setNeeds(List<DerivedNeed> needs)
needs - The needspublic void setDataCategories(List categories)
categories - list of categoriespublic List getDataCategories()
DataCategorys
DataCategorys defined for this descriptor.public void initForSearch()
DerivedNeed-s
public void clearAfterSearch()
DerivedNeed-s
public DerivedDataChoice getDataChoice()
public NamedList getDataChoices(Hashtable choicesSoFar)
choicesSoFar - table of choices to check
public Element toXml(Document doc)
doc - document
public String toString()
toString in class Objectpublic boolean equals(Object other)
equals in class Objectother - Object in question
public DataCategory getDisplayCategory()
DataCategory in the list of categories
that is for display purposes.
public String getJythonProcedure()
nullpublic String getJythonProcedure(String procname)
procname - procedure name
public void setIsEndUser(boolean value)
value - true if end userpublic boolean getIsEndUser()
public void setIsLocalUsers(boolean value)
value - true if end user editedpublic boolean getIsLocalUsers()
public void setIsDefault(boolean value)
value - true if defaultpublic boolean getIsDefault()
public void setFormula(String value)
value - formulapublic String getFormula()
public void setId(String value)
value - the idpublic String getId()
public void setDescription(String value)
value - the descriptionpublic String getDescription()
public void setDataContext(DataContext value)
value - the data contextpublic DataContext getDataContext()
public static List readDescriptors(DataContext dataContext,
Element root,
boolean isLocal)
dataContext - data contextroot - root elementisLocal - Is this one of the users local formulas
public static List readClasses(Element root)
root - root element
public static String toXml(List descriptors)
descriptors - list of descriptors to write out
public void updateDataGroups()
public static List init(DataContext dataContext,
XmlResourceCollection xrc)
dataContext - the data contextxrc - the resource collection of DDDs
public static void addToChoicesSoFar(Hashtable choicesSoFar,
DataChoice dataChoice)
choicesSoFar - existing choicesdataChoice - new choice
public static List getDerivedDataChoices(DataContext context,
List sourceChoices,
List descriptors)
context - context (the IDV)sourceChoices - choices to searchdescriptors - The descriptors
public static void main(String[] args)
args - arguments (not used)public void setOperandsCategories(String value)
value - The new value for OperandsCategoriespublic String getOperandsCategories()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||