|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jjt.utbeg.UserParameters
A persistent-capable Collection object for storing and retrieving parameters that a user sets across all exercise Applets.
This Object is backed by a Hashtable internally, and supports PropertyChangeListeners in a Java-bean-like way.
Field Summary | |
private PropertyChangeSupport |
changeSupport
Utility Object for registering and notifying PropertyChangeListeners. |
static String |
DEPTH_OF_PRIMARY_TARGET
|
static String |
DEPTH_TO_SHALLOWEST_TARGET
|
private Hashtable |
hashtable
The Collection in which to store key-value pairs, in this case parameterName-parameterValue. |
static String[] |
KNOWN_PARAMETER_NAMES
|
static String |
NUMBER_OF_RECEIVER_LINES
|
static String |
NUMBER_OF_SOURCE_LINES
|
static String |
RECEIVER_LINE_SPACING
|
static String |
RECEIVER_STATION_SPACING
|
static String |
REFERENCE_SWATH_SIZE
|
(package private) static long |
serialVersionUID
The serialized version number for Objects of this Class. |
static String |
SMALLEST_FEATURE_TO_IMAGE
|
static String |
SOURCE_LINE_SPACING
|
static String |
SOURCE_STATION_SPACING
|
static String |
STACKING_BIN_SIZE
|
Constructor Summary | |
UserParameters()
Creates a UserParameters Object with no parameters defined. |
|
UserParameters(boolean createTestParameters)
Test constructor for creating a UserParameters Object with some initial test parameters defined. |
Method Summary | |
void |
addPropertyChangeListener(PropertyChangeListener l)
Registers a listener to be notified when parameters change. |
void |
dump()
Debugging aid which dumps this Object to stderr. |
protected PropertyChangeSupport |
getChangeSupport()
Returns the internal support object for notifying listeners of property changes. |
double |
getDouble(String key)
Returns a double-precision floating point number for a given key. |
double |
getDouble(String key,
double defaultValue)
Returns a double-precision floating point number for a given key. |
int |
getInt(String key)
Returns an integer value for a parameter. |
int |
getInt(String key,
int defaultValue)
Returns an integer value for a parameter. |
static String[] |
getKnownParameterNames()
Returns a list of all parameter names known to be stored in UserParameters Objects. |
protected Number |
getNumber(String key)
Internal method to return a Number parameter. |
String |
getValueString(String parameterName)
Returns the value of a parameter represented by a String. |
boolean |
hasParameter(String parameterName)
Determines if a parameter value is stored in this collection. |
void |
removePropertyChangeListener(PropertyChangeListener l)
Unregisters a listener for this object. |
void |
set(String key,
double value)
Sets the value of a parameter. |
void |
set(String key,
int value)
Sets the value of a parameter. |
Methods inherited from class java.lang.Object |
|
Field Detail |
static final long serialVersionUID
This value must be updated when serialization compatibility is broken.
Serialization compatiblility is broken when, among other things, a non-
static
non-transient
field is deleted from the
class. static
and transient
fields are not
serialized with Objects, and therefore do not effect serialization.
New fields may be added without effecting compatibility.
public static final String DEPTH_TO_SHALLOWEST_TARGET
public static final String DEPTH_OF_PRIMARY_TARGET
public static final String SMALLEST_FEATURE_TO_IMAGE
public static final String STACKING_BIN_SIZE
public static final String SOURCE_STATION_SPACING
public static final String RECEIVER_STATION_SPACING
public static final String SOURCE_LINE_SPACING
public static final String RECEIVER_LINE_SPACING
public static final String REFERENCE_SWATH_SIZE
public static final String NUMBER_OF_SOURCE_LINES
public static final String NUMBER_OF_RECEIVER_LINES
public static final String[] KNOWN_PARAMETER_NAMES
private Hashtable hashtable
private transient PropertyChangeSupport changeSupport
This instance variable is transient
, so it it not
serialized when this Object is stored persistently.
Constructor Detail |
public UserParameters()
public UserParameters(boolean createTestParameters)
Method Detail |
public double getDouble(String key, double defaultValue)
key
- the name of the parameter to return.defaultValue
- the value to return if none is found.key
, or defaultValue
if
the value is not stored.key
is not
a Number.public double getDouble(String key)
key
- the name of the parameter to return.key
, or Double.NaN
if
the value is not stored.key
is not
a Number.public int getInt(String key, int defaultValue)
key
- the name of the parameter to return.key
, or defaultValue
if
the value is not stored.key
is not
a Number.protected Number getNumber(String key)
key
- the key within the Hashtable to return.key
.public int getInt(String key)
key
- the name of the parameter to return.key
, or Integer.MIN_VALUE
if
the value is not stored.key
is not
a Number.public void set(String key, int value)
key
- the name of the parameter to set.value
- the value to set the parameter as.public void set(String key, double value)
key
- the name of the parameter to set.value
- the value to set the parameter as.protected PropertyChangeSupport getChangeSupport()
public void addPropertyChangeListener(PropertyChangeListener l)
public void removePropertyChangeListener(PropertyChangeListener l)
public boolean hasParameter(String parameterName)
public String getValueString(String parameterName)
null
if the
parameter is not stored.public static String[] getKnownParameterNames()
public void dump()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |