View Javadoc

1   /**
2    * 
3    */
4   package org.sourceforge.jemm.sample.demo1.model.orig;
5   
6   import org.sourceforge.jemm.Entity;
7   
8   /**
9    * 
10   * @author Paul Keeble
11   * 
12   */
13  @Entity
14  public class Person {
15  	/** The number of accounts each person holds */
16  	public static final int NO_ACCOUNTS = 2;
17  
18  	protected final String name;
19  	protected Account account;
20  
21  	/**
22  	 * Create a Person instance.
23  	 * 
24  	 * @param name
25  	 *            The name of the person.
26  	 */
27  	public Person(String name) {
28  		this.name = name;
29  	}
30  
31  	/**
32  	 * Return the name of the account holder.
33  	 * 
34  	 * @return The account holders name.
35  	 */
36  	public String getName() {
37  		return name;
38  	}
39  
40  	/**
41  	 * Set the account at the given index.
42  	 * 
43  	 * @param index
44  	 *            The index of the new account.
45  	 * @param account
46  	 *            The new account to store.
47  	 */
48  	public void setAccount(Account account) {
49  		this.account = account;
50  	}
51  
52  	/**
53  	 * Return the account referred to by the given index.
54  	 * 
55  	 * @param index
56  	 *            The index of the target account.
57  	 * @return The account at the given index.
58  	 */
59  	public Account getAccount() {
60  		return account;
61  	}
62  
63  }