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 void
Add an alias for this object.protected void
addAliases
(List l) Add alist of aliases to thisDataAlias
static String
aliasToCanonical
(String paramName) Return the canonical name for the given alias.int
_more_static List
createDataAliases
(Element root) Process the given xml and return a list of DataAlias objects defined within the xml.boolean
See ifo
is equal to this.static DataAlias
Return the DataAlias object the given canonical name.Get aliases for the name of thisDataAlias
static List
getAliasesOf
(String paramName) Return the list of aliases (Strings) for the given canonical.static List
Return the list of canonical names (String
-s)getLabel()
Get the label of thisDataAlias
static List
Return the list of name/label pairs (TwoFacedObject
-s)getName()
Get the name of thisDataAlias
int
hashCode()
Override of hashCode method.static void
init
(XmlResourceCollection resources) Initialize the DataAlias-es with the given collection of xml resources,XmlResourceCollection
static void
reInit
(XmlResourceCollection resources) Reinitialize the data structures and reprocess the xml.void
Set the label of thisDataAlias
void
Set the name of thisDataAlias
toString()
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 thisDataAlias
label
- 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
-List
of names (String
-s)
-
hashCode
public int hashCode()Override of hashCode method. -
equals
See ifo
is 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:
List
of 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:
compareTo
in interfaceComparable
- Parameters:
o
- _more_- Returns:
- _more_
-
reInit
Reinitialize the data structures and reprocess the xml. This is called by theAliasEditor
when 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:
List
of names
-
getLabelIdList
Return the list of name/label pairs (TwoFacedObject
-s)- Returns:
List
of names
-
aliasToCanonical
Return the canonical name for the given alias.- Parameters:
paramName
- alias to look for- Returns:
- name of
DataAlias
corresponding toname
ornull
if no match is found.
-
getAliasesOf
Return the list of aliases (Strings) for the given canonical.- Parameters:
paramName
- canonical name (name) to look for- Returns:
List
of aliases for the canonical name.
-
findAlias
Return the DataAlias object the given canonical name.- Parameters:
paramName
- alias to look for- Returns:
- The
DataAlias
corresponding toname
ornull
if no match is found.
-
toString
Returns a string representation of this DataAlias.
-