|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--Model
| Constructor Summary | |
Model(int n)
|
|
| Method Summary | |
void |
buildObjects()
Create a List and fill it with N student objects. |
void |
checkAgents()
Use an iterator to go through the list, one agent at a time. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Model(int n)
| Method Detail |
public void buildObjects()
public void checkAgents()
Please note that there are different ways of using iterators to step through lists.
The first way I learned was the while() approach shown first. The second way is the "for loop" way java experts tend to do it.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||