|
|||||||
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.BaseList
This maintains a list of bases and allows interested objects to listen
for changes by implementing the Observer
interface.
Base
,
Observer
, Serialized FormConstructor Summary | |
BaseList()
Constructs an empty base list |
Method Summary | |
void |
addBase(Base base)
Adds a single base to the end of the base list and notifies registered Observer s of the change. |
void |
addBases(Base[] moreBases)
Adds the array of bases to the end of the base list and notifies registered Observer s of the change. |
Base[] |
getBases()
Returns an array of the bases in the list. |
void |
removeBase(Base base)
Removes a base by checking base == bases[i] for
each base in the list and notifies registered Observer s
of the change |
void |
removeBaseAt(int index)
Removes a base at a particular index and notifies registered Observer s of the change. |
void |
removeBasesAt(int[] indeces)
Removes bases at the specified indeces and notifies registered Observer s of the change. |
void |
replace(BaseList newList)
Replaces this list with newList . |
java.lang.String |
toString()
Returns "Number of bases: " + bases.length; |
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 |
public BaseList()
Method Detail |
public final void addBases(Base[] moreBases)
Observer
s of the change.moreBases
- array of bases to add to listBase
,
Observer
public final void addBase(Base base)
Observer
s of the change.base
- base to add to listBase
,
Observer
public final void removeBaseAt(int index)
Observer
s of the change.index
- index of base to removeBase
,
Observer
public final void removeBase(Base base)
base == bases[i]
for
each base in the list and notifies registered Observer
s
of the changebase
- base to removeBase
,
Observer
public final void removeBasesAt(int[] indeces)
Observer
s of the change.base
- base to removeBase
,
Observer
public final Base[] getBases()
public java.lang.String toString()
"Number of bases: " + bases.length;
toString
in class java.lang.Object
public final void update(java.util.Observable thing, java.lang.Object arg)
Observable
registers a change. The
list registers with bases. The list then notifies its own
registered Observer
s of the change.update
in interface java.util.Observer
thing
- thing that was updatedarg
- argument passed by thingObservable
,
Observer
public final void replace(BaseList newList)
newList
. This is used
when loading a new Kernel
. Observer
s
registered with the original list will still be registered, but
anything registered with newList
will not still
be registered.newList
- the new base list to use
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |