Package ucar.unidata.data
Class DataAlias
java.lang.Object
ucar.unidata.data.DataAlias
- All Implemented Interfaces:
Comparable
This class manages a set of data aliases - a mapping between
canonical names and a list of aliases for the canonical name.
This class is not instantiated - rather it provides a set of static
methods.
It is initialized by the IDV with an
XmlResourceCollection
that holds a set of aliases.xml files. The xml looks like:
<aliases> <alias name="TEMP" label="Temperature" aliases="T,t,Temperature,tdry" /> ... </aliases> </pre> Each alias tag holds a name (the canonical name), a label and a comma separated list of aliases for the name.
- Version:
- $Revision: 1.39 $
- Author:
- IDV development team
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdd an alias for this object.protected voidaddAliases(List l) Add alist of aliases to thisDataAliasstatic StringaliasToCanonical(String paramName) Return the canonical name for the given alias.int_more_static ListcreateDataAliases(Element root) Process the given xml and return a list of DataAlias objects defined within the xml.booleanSee ifois equal to this.static DataAliasReturn the DataAlias object the given canonical name.Get aliases for the name of thisDataAliasstatic ListgetAliasesOf(String paramName) Return the list of aliases (Strings) for the given canonical.static ListReturn the list of canonical names (String-s)getLabel()Get the label of thisDataAliasstatic ListReturn the list of name/label pairs (TwoFacedObject-s)getName()Get the name of thisDataAliasinthashCode()Override of hashCode method.static voidinit(XmlResourceCollection resources) Initialize the DataAlias-es with the given collection of xml resources,XmlResourceCollectionstatic voidreInit(XmlResourceCollection resources) Reinitialize the data structures and reprocess the xml.voidSet the label of thisDataAliasvoidSet the name of thisDataAliastoString()Returns a string representation of this DataAlias.
-
Field Details
-
TAG_ALIAS
Xml tag for canonical name- See Also:
-
TAG_ALIASES
Xml tag for aliases- See Also:
-
ATTR_ALIASES
Xml attribute for aliases- See Also:
-
ATTR_NAME
Xml attribute for name- See Also:
-
ATTR_LABEL
Xml attribute for label- See Also:
-
-
Constructor Details
-
DataAlias
Construct a new DataAlias with the given name and label.- Parameters:
name- name of thisDataAliaslabel- label of thisDataAlias. Used for displaying a "nice" string for this DataAlias.
-
-
Method Details
-
addAlias
Add an alias for this object.- Parameters:
alias- alias to add.
-
addAliases
Add alist of aliases to thisDataAlias- Parameters:
l-Listof names (String-s)
-
hashCode
public int hashCode()Override of hashCode method. -
equals
See ifois equal to this. -
setName
Set the name of thisDataAlias- Parameters:
value- new name.
-
getName
Get the name of thisDataAlias- Returns:
- name of this.
-
setLabel
Set the label of thisDataAlias- Parameters:
value- new label.
-
getLabel
Get the label of thisDataAlias- Returns:
- label.
-
getAliases
Get aliases for the name of thisDataAlias- Returns:
Listof names.
-
createDataAliases
Process the given xml and return a list of DataAlias objects defined within the xml.- Parameters:
root- root element of the XML- Returns:
- A list of DataAlias objects
-
compareTo
_more_- Specified by:
compareToin interfaceComparable- Parameters:
o- _more_- Returns:
- _more_
-
reInit
Reinitialize the data structures and reprocess the xml. This is called by theAliasEditorwhen aliases have been changed.- Parameters:
resources- collection of XML resources
-
init
Initialize the DataAlias-es with the given collection of xml resources,XmlResourceCollection- Parameters:
resources- collection of XML resources
-
getDataAliasList
Return the list of canonical names (String-s)- Returns:
Listof names
-
getLabelIdList
Return the list of name/label pairs (TwoFacedObject-s)- Returns:
Listof names
-
aliasToCanonical
Return the canonical name for the given alias.- Parameters:
paramName- alias to look for- Returns:
- name of
DataAliascorresponding tonameornullif no match is found.
-
getAliasesOf
Return the list of aliases (Strings) for the given canonical.- Parameters:
paramName- canonical name (name) to look for- Returns:
Listof aliases for the canonical name.
-
findAlias
Return the DataAlias object the given canonical name.- Parameters:
paramName- alias to look for- Returns:
- The
DataAliascorresponding tonameornullif no match is found.
-
toString
Returns a string representation of this DataAlias.
-