|
|||||||
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.SolutionList
This maintains a list of solutions and allows interested objects to listen
for changes by implementing the Observer
interface.
Solution
,
Observer
Constructor Summary | |
SolutionList()
Constructs an empty solution list |
Method Summary | |
void |
addSolution(Solution solution)
Adds a single solution to the end of the solution list and notifies registered Observer s of the change. |
void |
addSolutions(Solution[] moreSolutions)
Adds the array of solutions to the end of the solution list and notifies registered Observer s of the change. |
void |
clear()
Empties list. |
Solution[] |
getSolutions()
Returns an array of the solutions in the list. |
void |
removeSolution(Solution solution)
Removes a solution by checking solution == solutions[i] for
each solution in the list and notifies registered Observer s
of the change |
void |
removeSolutionAt(int index)
Removes a solution at a particular index and notifies registered Observer s of the change. |
void |
removeSolutionsAt(int[] indeces)
Removes solutions at the specified indeces and notifies registered Observer s of the change. |
java.lang.String |
toString()
|
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 SolutionList()
Method Detail |
public final void addSolutions(Solution[] moreSolutions)
Observer
s of the change.moresolutions
- array of solutions to add to listSolution
,
Observer
public final void addSolution(Solution solution)
Observer
s of the change.solution
- solution to add to listSolution
,
Observer
public final void removeSolutionAt(int index)
Observer
s of the change.index
- index of solution to removeSolution
,
Observer
public final void removeSolution(Solution solution)
solution == solutions[i]
for
each solution in the list and notifies registered Observer
s
of the changesolution
- solution to removeSolution
,
Observer
public final void removeSolutionsAt(int[] indeces)
Observer
s of the change.solution
- solution to removeSolution
,
Observer
public final Solution[] getSolutions()
public final void clear()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |