ucar.unidata.data
Class UserDataChoice

java.lang.Object
  extended by ucar.unidata.data.DataChoice
      extended by ucar.unidata.data.UserDataChoice

public class UserDataChoice
extends DataChoice

Represents a DataChoice in a formula that is numeric.

Version:
$Revision: 1.26 $
Author:
IDV development team

Field Summary
protected  String label
          DataChoice label
 boolean persistent
          A hack used by the DerivedDataChoice for when we don't save the user entered choices in a bundle
protected  Object value
          numeric value
 
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
UserDataChoice()
          Default constructor; used for unpersistence
UserDataChoice(String label)
          Create a new UserDataChoice
UserDataChoice(String label, String defaultValue)
          Create a new UserDataChoice
UserDataChoice(UserDataChoice other)
          Copy constructor, set properties from the other.
 
Method Summary
 void addDataChangeListener(DataChangeListener listener)
          Add a DataChangeListener.
 DataChoice cloneMe()
          Make a clone of me.
 boolean equals(Object other)
          Check for equality.
protected  Data getData(DataCategory category, DataSelection dataSelection, Hashtable requestProperties)
          A no-op
 String getDefaultValue()
          Get the DefaultValue property.
 String getLabel()
          Get the label for this.
 Object getValue()
          Get the value for this choice.
 void removeDataChangeListener(DataChangeListener listener)
          Remove a DataChangeListener.
 void setDefaultValue(String value)
          Set the DefaultValue property.
 void setLabel(String l)
          Set the label for this
 void setValue(Object v)
          Set the value for this choice.
 String toString()
          Return a String representation of this UserDataChoice.
 
Methods inherited from class ucar.unidata.data.DataChoice
addCategory, addCurrentName, addParamNameToCategories, basicallyEquals, cloneDataChoices, createClone, getAllDateTimes, getAllLevels, getAllLevels, getCategories, getCurrentNames, getData, getData, getDataCategories, getDataCategories, getDataSelection, getDataSources, getDescription, getDisplayCategory, getFinalDataChoices, getFixedRequestProperties, getForUser, getFullDescription, getId, getIndexedName, getName, getParent, getProperties, getProperty, getProperty, getProperty, getSelectedDateTimes, getStringId, hashCode, initAfterUnPersistence, isEndUserFormula, mergeRequestProperties, setCategories, setDataCategories, setDataSelection, setDescription, setFixedRequestProperties, setId, setLevelSelection, setName, setObjectProperty, setParent, setProperties, setProperty, setProperty, setTimeSelection
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

persistent

public boolean persistent
A hack used by the DerivedDataChoice for when we don't save the user entered choices in a bundle


label

protected String label
DataChoice label


value

protected Object value
numeric value

Constructor Detail

UserDataChoice

public UserDataChoice()
Default constructor; used for unpersistence


UserDataChoice

public UserDataChoice(UserDataChoice other)
Copy constructor, set properties from the other.

Parameters:
other - other UserDataChoice for properties

UserDataChoice

public UserDataChoice(String label)
Create a new UserDataChoice

Parameters:
label - label for this choice

UserDataChoice

public UserDataChoice(String label,
                      String defaultValue)
Create a new UserDataChoice

Parameters:
label - label for this choice
defaultValue - The defaultValue
Method Detail

cloneMe

public DataChoice cloneMe()
Make a clone of me.

Specified by:
cloneMe in class DataChoice
Returns:
a new me!

getLabel

public String getLabel()
Get the label for this.

Returns:
the label

setLabel

public void setLabel(String l)
Set the label for this

Parameters:
l - new label

toString

public String toString()
Return a String representation of this UserDataChoice.

Overrides:
toString in class DataChoice
Returns:
a String representation of this UserDataChoice

getValue

public Object getValue()
Get the value for this choice.

Returns:
the value

setValue

public void setValue(Object v)
Set the value for this choice.

Parameters:
v - the value

equals

public boolean equals(Object other)
Check for equality.

Overrides:
equals in class DataChoice
Parameters:
other - object in question
Returns:
true if o equals this

getData

protected Data getData(DataCategory category,
                       DataSelection dataSelection,
                       Hashtable requestProperties)
                throws VisADException,
                       RemoteException
A no-op

Specified by:
getData in class DataChoice
Parameters:
category - The data category of the request.
dataSelection - Identifies any subsetting of the data.
requestProperties - Hashtable that holds any detailed request properties.
Returns:
null
Throws:
RemoteException - Java RMI problem
VisADException - VisAD problem

addDataChangeListener

public void addDataChangeListener(DataChangeListener listener)
Add a DataChangeListener. Does nothing

Specified by:
addDataChangeListener in class DataChoice
Parameters:
listener - listener to add

removeDataChangeListener

public void removeDataChangeListener(DataChangeListener listener)
Remove a DataChangeListener. Does nothing

Specified by:
removeDataChangeListener in class DataChoice
Parameters:
listener - listener to remove

setDefaultValue

public void setDefaultValue(String value)
Set the DefaultValue property.

Parameters:
value - The new value for DefaultValue

getDefaultValue

public String getDefaultValue()
Get the DefaultValue property.

Returns:
The DefaultValue