View Javadoc

1   /*
2    * Copyright (c) 1998-2004 The Jgroup Team.
3    *
4    * This program is free software; you can redistribute it and/or modify
5    * it under the terms of the GNU Lesser General Public License version 2 as
6    * published by the Free Software Foundation.
7    *
8    * This program is distributed in the hope that it will be useful,
9    * but WITHOUT ANY WARRANTY; without even the implied warranty of
10   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11   * GNU Lesser General Public License for more details.
12   *
13   * You should have received a copy of the GNU Lesser General Public License
14   * along with this program; if not, write to the Free Software
15   * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16   *
17   */
18  package jgroup.test.jini.txn;
19  
20  /**
21   * Persistent class used to save Accounts. Used together with
22   * the package.jdo file.
23   * 
24   * @author Rohnny Moland
25   */
26  public class Account
27  {
28    private long number;
29    private int balance;
30    
31    /** Empty constructor */
32    public Account() {}
33    
34    /**
35     * Creates a new account.
36     * 
37     * @param number Account number
38     * @param balance Balance of account
39     */
40    public Account(long number, int balance)
41    {
42      this.number = number;
43      this.balance = balance;
44    }
45    
46    /**
47     * Get the account number of an account.
48     * 
49     * @return account number
50     */
51    public long getNumber() 
52    {
53      return this.number;
54    }
55    
56    /**
57     * Get the balance of an account.
58     * 
59     * @return balance of account
60     */
61    public int getBalance() 
62    {
63      return this.balance;
64    }
65    
66    /**
67     * Set the account number of an account.
68     * 
69     * @param number new Account number
70     */
71    public void setNumber(long number)
72    {
73      this.number = number;
74    }
75    
76    /**
77     * Set balance of an account. 
78     * 
79     * @param balance New balance
80     */
81    public void setBalance(int balance) 
82    {
83      this.balance = balance;
84    }
85  }