KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jac > aspects > gui > Currency


1 /*
2   Copyright (C) 2001-2002 Laurent Martelli
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 as
6   published by the Free Software Foundation; either version 2 of the
7   License, or (at your option) any later version.
8
9   This program is distributed in the hope that it will be useful, but
10   WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12   Lesser General Public License for more details.
13
14   You should have received a copy of the GNU Lesser General Public
15   License along with this program; if not, write to the Free Software
16   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17   USA */

18
19 package org.objectweb.jac.aspects.gui;
20
21 /**
22  * Holds information about a currency: its name, display precision
23  * and change rate.
24  */

25 public class Currency
26 {
27    String JavaDoc name;
28    int precision;
29    double rate;
30
31    /**
32     * Constructs the currency.
33     *
34     * @param name the currency name
35     * @param precision the currency precision (decimal number)
36     * @param rate the exchange rate regarding the default currency */

37
38    public Currency(String JavaDoc name, int precision, double rate) {
39       this.name = name;
40       this.precision = precision;
41       this.rate = rate;
42    }
43    
44    /**
45     * Gets the currency name. */

46    public String JavaDoc getName() {
47       return name;
48    }
49
50    /**
51     * Gets the currency precision. */

52    public int getPrecision() {
53       return precision;
54    }
55    
56    /**
57     * Gets the exchange rate regarding the default currency. */

58    public double getRate() {
59       return rate;
60    }
61 }
62
Popular Tags