1   /*
2    * Created on May 13, 2004
3    *
4    */
5   package functional.agent;
6   
7   
8   
9   /***
10   * This object does..
11   *  @author navery
12   */
13  public class SimpleAgentImpl implements SimpleAgent {
14  	
15  	boolean done = false;
16  	String name;
17  	
18  	public String getName() {
19  		return name;
20  	}
21  	public void setName(String name) {
22  		this.name = name;
23  	}
24  
25  	public void startUnitOfWork(Integer amountOfWork) {
26  		for (int i = 0; i < amountOfWork.intValue(); i++ ) {
27  			if (i % 10000 == 0) {
28  				System.out.println(getName() + " work:"+ i);
29  			}
30  		}
31  		done = true;
32  	}
33  	
34  	/* (non-Javadoc)
35  	 * @see functional.agent.controller.SimpleAgent#isFinished()
36  	 */
37  	public Boolean isFinished() {
38  		return new Boolean(this.done);
39  	}
40  }