public class Preferences
extends java.lang.Object
implements java.lang.Cloneable
Preferences
class handles preferences set by the
user for CoastWatch tool operations.Constructor and Description |
---|
Preferences()
Creates a new empty set of preferences.
|
Preferences(java.io.InputStream input)
Creates a new preferences object by parsing the specified XML
input.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates and returns a copy of this object.
|
int |
getCacheSize()
Gets the tile cache size in megabytes.
|
boolean |
getEarthLocDegrees()
Gets the earth location in decimal degrees flag.
|
ColorEnhancementSettings |
getEnhancement(java.lang.String variableName)
Gets the enhancement settings for the specified variable.
|
java.util.List |
getEnhancementVariables()
Gets the enhancement setting variable names.
|
int |
getHeapSize()
Gets the heap size in megabytes.
|
java.lang.String |
getUnits(java.lang.String varName)
Gets the preferred units for a variable.
|
java.util.Map |
getUnitsMap()
Gets the map of variable name to units.
|
void |
removeEnhancement(java.lang.String variableName)
Removes the specified enhancement settings from the preferences.
|
void |
removeUnits(java.lang.String varName)
Removes the preferred units for a variable.
|
void |
setCacheSize(int cacheSize)
Sets the tile cache size in megabytes.
|
void |
setEarthLocDegrees(boolean flag)
Sets the earth location in decimal degrees flag.
|
void |
setEnhancement(ColorEnhancementSettings settings)
Adds new enhancement settings to the preferences.
|
void |
setHeapSize(int heapSize)
Sets the heap size in megabytes.
|
void |
setUnits(java.lang.String varName,
java.lang.String units)
Sets the preferred units for a variable.
|
void |
write(java.io.OutputStream output)
Writes this set of preferences to the specified output stream in
an XML format.
|
void |
writeOptions(java.io.OutputStream output)
Writes the set of options to the specified output stream.
|
public Preferences()
public Preferences(java.io.InputStream input) throws java.io.IOException
input
- the input XML stream to read.java.io.IOException
- if the input had format errors.public java.util.Map getUnitsMap()
public void setUnits(java.lang.String varName, java.lang.String units)
varName
- the variable name to set units for.units
- the new units string for the variable.public java.lang.String getUnits(java.lang.String varName)
varName
- the variable name to get units for.public void removeUnits(java.lang.String varName)
varName
- the variable name to remove units for.public boolean getEarthLocDegrees()
public void setEarthLocDegrees(boolean flag)
public void setHeapSize(int heapSize)
public int getHeapSize()
public void setCacheSize(int cacheSize)
public int getCacheSize()
public java.lang.Object clone()
clone
in class java.lang.Object
public java.util.List getEnhancementVariables()
public ColorEnhancementSettings getEnhancement(java.lang.String variableName)
variableName
- the variable name for which to retrieve
settings.public void setEnhancement(ColorEnhancementSettings settings)
settings
- the new enhancement settings to add.public void removeEnhancement(java.lang.String variableName)
variableName
- the enhancement settings variable to remove.public void writeOptions(java.io.OutputStream output)
output
- the output stream to write.public void write(java.io.OutputStream output)
output
- the output stream to write.