|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Observable | +--mil.af.afit.router.Preferences
This class saves various preferences for a Kernel
and optionally
for any application that uses the kernel. Although some methods are available
for use by specific components of this software package, any code interested
in saving information (for example: window positions or last directory accessed)
can use the getProperty
and setProperty
methods to
save strings.
Kernel
, Serialized FormField Summary | |
static java.lang.String |
EFFORT
Amount of effort specified. |
static java.lang.String |
HEADER
Header used when saving preferences to a file. |
static java.lang.String |
SITE_DEFAULT_PRIORITY
Default site priority for new sites. |
static java.lang.String |
SITE_DEFAULT_SERVICE_TIME
Default site service (loiter) time for new sites. |
static java.lang.String |
SOLVER
Name of last solver that was used. |
static java.lang.String |
THREADS
Number of threads to specify for solvers to use. |
static java.lang.String |
USE_POST_OPT
Whether or not to use the extra post-optimization when solving. |
static java.lang.String |
VEHICLE_DEFAULT_ALTITUDE
Default vehicle altitude (in feet) for new vehicles. |
static java.lang.String |
VEHICLE_DEFAULT_RANGE
Default vehicle range (in hours) for new vehicles. |
static java.lang.String |
VEHICLE_DEFAULT_SPEED
Default vehicle speed (in knots) for new vehicles. |
static java.lang.String |
WINDOW_DEFAULT_X
Default x position of upper left corner for new windows. |
static java.lang.String |
WINDOW_DEFAULT_Y
Default y position of upper left corner of new windows. |
Constructor Summary | |
Preferences()
Constructs preferences with default values. |
Method Summary | |
int |
getDefaultPriority()
Returns the default priority for sites. |
int |
getDefaultServiceTime()
Returns the default service (loiter) time (in minutes) for sites. |
int |
getDefaultWindowX()
Returns the default x position to use on new windows. |
int |
getDefaultWindowY()
Returns the default y position to use on new windows. |
int |
getLastNumberOfThreads()
Returns the number of threads that solvers should try to use. |
double |
getLastRequestedSolutionEffort()
Returns the amount of effort (from zero to one) requested by the user. |
java.util.Properties |
getProperties()
Returns all the properties contained in the preferences. |
java.lang.String |
getProperty(java.lang.String key)
Returns the property stored by key. |
void |
readExternal(java.io.ObjectInput oi)
Needs an InputStream to work properly. |
void |
replace(Preferences newPrefs)
Replaces these preferences with newPrefs. |
void |
replace(java.util.Properties props)
Replaces these preferences with the properties stored in props. |
void |
setDefaultPriority(int priority)
Sets the default priority for new sites. |
void |
setDefaultServiceTime(int time)
Sets the default service (loiter) time (in minutes) for new sites. |
void |
setDefaultWindowXPosition(int x)
Sets the default x position for new windows. |
void |
setDefaultWindowYPosition(int y)
Sets the default y position for new windows. |
void |
setLastNumberOfThreads(int threads)
Sets the number of threads for solvers to try to use. |
void |
setLastRequestedSolutionEffort(double effort)
Sets the effort to use when solving. |
void |
setProperty(java.lang.String key,
java.lang.String thing)
Sets a property stored in key. |
void |
setUsePostOptimization(boolean state)
Sets whether or not to use post-optimization when solving. |
boolean |
usePostOptimization()
Returns whether or not to use the extra post-optimization when solving. |
void |
writeExternal(java.io.ObjectOutput oo)
Needs an OutputStream to work properly. |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String WINDOW_DEFAULT_X
public static final java.lang.String WINDOW_DEFAULT_Y
public static final java.lang.String VEHICLE_DEFAULT_SPEED
public static final java.lang.String VEHICLE_DEFAULT_ALTITUDE
public static final java.lang.String VEHICLE_DEFAULT_RANGE
public static final java.lang.String SITE_DEFAULT_PRIORITY
public static final java.lang.String SITE_DEFAULT_SERVICE_TIME
public static final java.lang.String SOLVER
public static final java.lang.String EFFORT
public static final java.lang.String USE_POST_OPT
public static final java.lang.String THREADS
public static final java.lang.String HEADER
Constructor Detail |
public Preferences()
Method Detail |
public final int getDefaultWindowX()
public final int getDefaultWindowY()
public final boolean usePostOptimization()
HSolver
public final double getLastRequestedSolutionEffort()
public final int getLastNumberOfThreads()
public final int getDefaultServiceTime()
Site
public final int getDefaultPriority()
Site
public final java.lang.String getProperty(java.lang.String key)
key
- key for property to retrievepublic final java.util.Properties getProperties()
Properties
public final void setDefaultWindowXPosition(int x)
x
- default x position for new windows.public final void setDefaultWindowYPosition(int y)
x
- default y position for new windows.public final void setUsePostOptimization(boolean state)
state
- whether or not to use post-optimization when solvingpublic final void setLastRequestedSolutionEffort(double effort)
effort
- effort to use when solvingpublic final void setLastNumberOfThreads(int threads)
threads
- the number of threads for solvers to try to use.public final void setDefaultServiceTime(int time)
time
- the default service (loiter) time (in minutes) for new sites.public final void setDefaultPriority(int priority)
time
- the default priority for new sites.public final void setProperty(java.lang.String key, java.lang.String thing)
java.util.Properties
.key
- key for storing the propertything
- property to storeProperties
public final void replace(Preferences newPrefs)
Kernel
. Observer
s
registered with the original preferences will still be registered, but
anything registered with newPrefs will not still
be registered.newPrefs
- the new preferences to usepublic final void replace(java.util.Properties props)
replace( newPrefs )
method.props
- the properties for the new preferences to usepublic void readExternal(java.io.ObjectInput oi) throws java.io.IOException
readExternal
in interface java.io.Externalizable
public void writeExternal(java.io.ObjectOutput oo) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |