mil.af.afit.router
Class Kernel

java.lang.Object
  |
  +--java.util.Observable
        |
        +--mil.af.afit.router.Kernel
All Implemented Interfaces:
java.util.Observer, java.io.Serializable

public class Kernel
extends java.util.Observable
implements java.util.Observer, java.io.Serializable

The Kernel is the main point of contact between higher level applications like mapping software and the data storage and routing abilities of this software. The Kernel maintains the lists of sites, vehicles bases, solutions, etc. and allows interested Observers to listen for changes. The Kernel maintains the points of contact for starting the solving process.

Since:
1.0
See Also:
SiteList, VehicleList, BaseList, RestrictedOperatingZoneList, PriorityModelList, SolutionList, WindList, Site, Vehicle, Base, RestrictedOperatingZone, PriorityModel, Solution, Wind, Preferences, Serialized Form

Constructor Summary
Kernel()
          Constructs a Kernel with empty lists and default preferences.
 
Method Summary
static void err(java.lang.Exception e)
          Used in debugging.
 BaseList getBaseList()
          Returns the Base list.
 java.lang.Object getClientProperty(java.lang.String key)
          Returns the object stored in the kernel's key entry in its transient hashtable.
 Preferences getPrefs()
          Returns the preferences
 PriorityModelList getPriorityModelList()
          Returns the priority model list.
 RequirementsList getRequirementsList()
          Returns the Requirements list.
 RestrictedOperatingZoneList getROZList()
          Returns the restricted operating zones list.
 SiteList getSiteList()
          Returns the site list.
 SolutionList getSolutionList()
          Returns the Solution list.
 VehicleList getVehicleList()
          Returns the Vehicle list.
 WindList getWindList()
          Returns the Wind list.
 boolean isRunningAsApplet()
          Returns whether or not the kernel is being run in an applet environment.
 boolean isRunningAsApplication()
          Returns whether or not the kernel is being run in an application environment.
static void out(java.lang.Object obj)
          Used in debugging.
 void putClientProperty(java.lang.String key, java.lang.Object thing)
          Stores an object in the kernel's transient hashtable.
 void replace(Kernel newKernel)
          Replaces this kernel with newKernel while maintaining the Observers registered with all objects.
 void setPrefs(Preferences prefs)
          Sets the Preferences object being used by the kernel and notifies registered Observers of the change.
 void setRunningAsApplet()
          Marks kernel as being run in an applet environment.
 void setRunningAsApplication()
          Marks kernel as being run in an application environment.
 void startSolving()
          Starts the kernel solving and immediately returns control.
 void startSolving(KernelSolverListener listener)
          Starts the kernel solving and immediately registers listener as a KernelSolverListener.
 void update(java.util.Observable thing, java.lang.Object arg)
          When notfied, the kernel just passes on the notification to interested Observers.
 
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
 

Constructor Detail

Kernel

public Kernel()
Constructs a Kernel with empty lists and default preferences.
Since:
1.0
Method Detail

getSiteList

public final SiteList getSiteList()
Returns the site list.
Returns:
the site list
Since:
1.0
See Also:
SiteList

getVehicleList

public final VehicleList getVehicleList()
Returns the Vehicle list.
Returns:
the vehicle list
Since:
1.0
See Also:
VehicleList

getBaseList

public final BaseList getBaseList()
Returns the Base list.
Returns:
the base list
Since:
1.0
See Also:
BaseList

getWindList

public final WindList getWindList()
Returns the Wind list.
Returns:
the wind list
Since:
1.0
See Also:
WindList

getSolutionList

public final SolutionList getSolutionList()
Returns the Solution list.
Returns:
the solution list
Since:
1.0
See Also:
SolutionList

getRequirementsList

public final RequirementsList getRequirementsList()
Returns the Requirements list.
Returns:
the requirements list
Since:
1.0
See Also:
RequirementsList

getROZList

public final RestrictedOperatingZoneList getROZList()
Returns the restricted operating zones list.
Returns:
the reqrestricted operating zones list
Since:
1.0
See Also:
RestrictedOperatingZoneList

getPrefs

public final Preferences getPrefs()
Returns the preferences
Returns:
preferences
Since:
1.0
See Also:
Preferences

getPriorityModelList

public final PriorityModelList getPriorityModelList()
Returns the priority model list.
Returns:
the priority model list
Since:
1.0
See Also:
PriorityModelList

getClientProperty

public final java.lang.Object getClientProperty(java.lang.String key)
Returns the object stored in the kernel's key entry in its transient hashtable.
Parameters:
key - key of object to retrieve
See Also:
Hashtable

isRunningAsApplet

public final boolean isRunningAsApplet()
Returns whether or not the kernel is being run in an applet environment. This is dependent on this property being set after a kernel is instantiated or deserialized.
Returns:
whether or not kernel is running in an applet environment
Since:
1.0

isRunningAsApplication

public final boolean isRunningAsApplication()
Returns whether or not the kernel is being run in an application environment. This is dependent on this property being set after a kernel is instantiated or deserialized.
Returns:
whether or not kernel is running in an application environment
Since:
1.0

setPrefs

public final void setPrefs(Preferences prefs)
Sets the Preferences object being used by the kernel and notifies registered Observers of the change.
Parameters:
prefs - new preferences to use
Since:
1.0
See Also:
Preferences

putClientProperty

public final void putClientProperty(java.lang.String key,
                                    java.lang.Object thing)
Stores an object in the kernel's transient hashtable. These objects will not be saved when the kernel is serialized. It is intended to save objects relevant to a particular instance of the kernel, such as a hosting window or application.
Parameters:
key - key for object to store
Since:
1.0
See Also:
Hashtable

setRunningAsApplet

public final void setRunningAsApplet()
Marks kernel as being run in an applet environment. This is not used by any internal objects but is provided as a convenience for calling codes. Using the get/put client property methods is the preferred way of saving runtime information.
Since:
1.0

setRunningAsApplication

public final void setRunningAsApplication()
Marks kernel as being run in an application environment. This is not used by any internal objects but is provided as a convenience for calling codes. Using the get/put client property methods is the preferred way of saving runtime information.
Since:
1.0

startSolving

public final void startSolving()
Starts the kernel solving and immediately returns control.
Since:
1.0

startSolving

public final void startSolving(KernelSolverListener listener)
Starts the kernel solving and immediately registers listener as a KernelSolverListener.
Since:
1.0
See Also:
KernelSolverListener

replace

public void replace(Kernel newKernel)
Replaces this kernel with newKernel while maintaining the Observers registered with all objects.
Parameters:
newKernel - new kernel to use
Since:
1.0

update

public final void update(java.util.Observable thing,
                         java.lang.Object arg)
When notfied, the kernel just passes on the notification to interested Observers. The Observable that called update is passed as the argument to the kernel's Observers.
Specified by:
update in interface java.util.Observer
Parameters:
thing - thing that changed
Since:
1.0
See Also:
Observer, Observable

out

public static final void out(java.lang.Object obj)
Used in debugging.

err

public static final void err(java.lang.Exception e)
Used in debugging.