|
|||||||
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.SiteList
This maintains a list of sites and allows interested objects to listen
for changes by implementing the Observer
interface.
Site
,
Observer
, Serialized FormField Summary | |
static int |
ASCENDING
|
static int |
DESCENDING
|
Constructor Summary | |
SiteList()
Constructs an empty site list |
Method Summary | |
void |
addSite(Site site)
Adds a single site to the end of the site list and notifies registered Observer s of the change. |
void |
addSites(Site[] moreSites)
Adds the array of sites to the end of the site list and notifies registered Observer s of the change. |
int |
countEnabledSites()
Returns the number of enabled sites in list. |
int |
getEarliestTimeWindow()
Returns earliest time window. |
int |
getLatestTimeWindow()
Returns latest time window. |
Site[] |
getSites()
Returns an array of the sites in the list. |
java.lang.String |
lastSortKey()
Returns last key used to sort. |
boolean |
lastSortWasAscending()
Returns whether or not the last sort performed was ascending. |
boolean |
lastSortWasDescending()
Returns whether or not the last sort performed was descending. |
void |
removeSite(Site site)
Removes a site by checking site == sites[i] for
each site in the list and notifies registered Observer s
of the change |
void |
removeSiteAt(int index)
Removes a site at a particular index and notifies registered Observer s of the change. |
void |
removeSitesAt(int[] indeces)
Removes sites at the specified indeces and notifies registered Observer s of the change. |
void |
replace(SiteList newList)
Replaces this list with newList . |
void |
sortByEarliestArrivalTime(boolean ascending)
Sort by beginning of time window. |
void |
sortByEarliestRestrictedTime(boolean ascending)
Sort by beginning of time wall. |
void |
sortByEnabled(boolean ascending)
Sort by enabled. |
void |
sortByLatestDepartureTime(boolean ascending)
Sort by ending of time window. |
void |
sortByLatestRestrictedTime(boolean ascending)
Sort by ending of time wall. |
void |
sortByLatitude(boolean ascending)
Sort by latitude. |
void |
sortByLongitude(boolean ascending)
Sort by longitude. |
void |
sortByName(boolean ascending)
Sort by name. |
void |
sortByPriority(boolean ascending)
Sort by priority. |
void |
sortByRequirementType(boolean ascending)
Sort by requirement type. |
void |
sortByServiceTime(boolean ascending)
Sort by service time. |
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 |
Field Detail |
public static final int ASCENDING
public static final int DESCENDING
Constructor Detail |
public SiteList()
Method Detail |
public final void addSites(Site[] moreSites)
Observer
s of the change.moreSites
- array of sites to add to listSite
,
Observer
public final void addSite(Site site)
Observer
s of the change.site
- site to add to listSite
,
Observer
public final void removeSiteAt(int index)
Observer
s of the change.index
- index of site to removeSite
,
Observer
public final void removeSite(Site site)
site == sites[i]
for
each site in the list and notifies registered Observer
s
of the changesite
- site to removeSite
,
Observer
public final void removeSitesAt(int[] indeces)
Observer
s of the change.site
- site to removeSite
,
Observer
public final boolean lastSortWasAscending()
public final boolean lastSortWasDescending()
public final java.lang.String lastSortKey()
public final void sortByName(boolean ascending)
ascending
- whether or not sort should be in ascending orderpublic final void sortByPriority(boolean ascending)
ascending
- whether or not sort should be in ascending orderpublic final void sortByServiceTime(boolean ascending)
ascending
- whether or not sort should be in ascending orderpublic final void sortByEarliestArrivalTime(boolean ascending)
ascending
- whether or not sort should be in ascending orderpublic final void sortByLatestDepartureTime(boolean ascending)
ascending
- whether or not sort should be in ascending orderpublic final void sortByEarliestRestrictedTime(boolean ascending)
ascending
- whether or not sort should be in ascending orderpublic final void sortByLatestRestrictedTime(boolean ascending)
ascending
- whether or not sort should be in ascending orderpublic final void sortByEnabled(boolean ascending)
ascending
- whether or not sort should be in ascending orderpublic final void sortByRequirementType(boolean ascending)
ascending
- whether or not sort should be in ascending orderpublic final void sortByLatitude(boolean ascending)
ascending
- whether or not sort should be in ascending orderpublic final void sortByLongitude(boolean ascending)
ascending
- whether or not sort should be in ascending orderpublic void update(java.util.Observable thing, java.lang.Object arg)
Observable
registers a change. The
list registers with sites. 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 Site[] getSites()
public java.lang.String toString()
toString
in class java.lang.Object
public final int countEnabledSites()
public final int getEarliestTimeWindow()
public final int getLatestTimeWindow()
public final void replace(SiteList 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 site list to use
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |