mil.af.afit.router
Class RestrictedOperatingZoneList

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

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

This maintains a list of rozs and allows interested objects to listen for changes by implementing the Observer interface.

Since:
1.0
See Also:
RestrictedOperatingZone, Observer, Serialized Form

Constructor Summary
RestrictedOperatingZoneList()
          Constructs an empty roz list
 
Method Summary
 void addROZ(RestrictedOperatingZone roz)
          Adds a single roz to the end of the roz list and notifies registered Observers of the change.
 void addROZs(RestrictedOperatingZone[] moreRestrictedOperatingZones)
          Adds the array of rozs to the end of the roz list and notifies registered Observers of the change.
 RestrictedOperatingZone[] getROZs()
          Returns an array of the rozs in the list.
 void removeRestrictedOperatingZone(RestrictedOperatingZone roz)
          Removes a roz by checking roz == rozs[i] for each roz in the list and notifies registered Observers of the change
 void removeRestrictedOperatingZoneAt(int index)
          Removes a roz at a particular index and notifies registered Observers of the change.
 void removeRestrictedOperatingZonesAt(int[] indeces)
          Removes rozs at the specified indeces and notifies registered Observers of the change.
 void replace(RestrictedOperatingZoneList newList)
          Replaces this list with newList.
 java.lang.String toString()
           
 void update(java.util.Observable thing, java.lang.Object arg)
          Called when an Observable registers a change.
 
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, wait, wait, wait
 

Constructor Detail

RestrictedOperatingZoneList

public RestrictedOperatingZoneList()
Constructs an empty roz list
Since:
1.0
Method Detail

addROZs

public final void addROZs(RestrictedOperatingZone[] moreRestrictedOperatingZones)
Adds the array of rozs to the end of the roz list and notifies registered Observers of the change.
Parameters:
moreRestrictedOperatingZones - array of rozs to add to list
See Also:
RestrictedOperatingZone, Observer

addROZ

public final void addROZ(RestrictedOperatingZone roz)
Adds a single roz to the end of the roz list and notifies registered Observers of the change.
Parameters:
roz - roz to add to list
See Also:
RestrictedOperatingZone, Observer

removeRestrictedOperatingZoneAt

public final void removeRestrictedOperatingZoneAt(int index)
Removes a roz at a particular index and notifies registered Observers of the change.
Parameters:
index - index of roz to remove
See Also:
RestrictedOperatingZone, Observer

removeRestrictedOperatingZone

public final void removeRestrictedOperatingZone(RestrictedOperatingZone roz)
Removes a roz by checking roz == rozs[i] for each roz in the list and notifies registered Observers of the change
Parameters:
roz - roz to remove
See Also:
RestrictedOperatingZone, Observer

removeRestrictedOperatingZonesAt

public final void removeRestrictedOperatingZonesAt(int[] indeces)
Removes rozs at the specified indeces and notifies registered Observers of the change.
Parameters:
roz - roz to remove
See Also:
RestrictedOperatingZone, Observer

getROZs

public final RestrictedOperatingZone[] getROZs()
Returns an array of the rozs in the list.
Returns:
array of rozs in the list
Since:
1.0

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

update

public final void update(java.util.Observable thing,
                         java.lang.Object arg)
Called when an Observable registers a change. The list registers with rozs. The list then notifies its own registered Observers of the change.
Specified by:
update in interface java.util.Observer
Parameters:
thing - thing that was updated
arg - argument passed by thing
Since:
1.0
See Also:
Observable, Observer

replace

public final void replace(RestrictedOperatingZoneList newList)
Replaces this list with newList. This is used when loading a new Kernel. Observers registered with the original list will still be registered, but anything registered with newList will not still be registered.
Parameters:
newList - the new roz list to use
Since:
1.0