Class Model

java.lang.Object
  |
  +--Model

public class Model
extends java.lang.Object


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

Model

public Model(int n)
Method Detail

buildObjects

public void buildObjects()
Create a List and fill it with N student objects.

checkAgents

public void checkAgents()
Use an iterator to go through the list, one agent at a time.

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.