task2/solution13/src/org/apidesign/apifest08/currency/ExchangeRate.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Wed, 01 Oct 2008 10:43:05 +0200
changeset 29 f6073056b9fe
parent 23 task1/solution13/src/org/apidesign/apifest08/currency/ExchangeRate.java@f4b4f95ae1bd
child 41 a7e6f84fb078
permissions -rw-r--r--
Getting ready for task2: copying all solutions to new locations
     1 
     2 package org.apidesign.apifest08.currency;
     3 
     4 import java.math.BigDecimal;
     5 
     6 /**
     7  * Exchange rate value. Contains <code>from</code> and <code>to</code> value.
     8  * 
     9  * @author arnostvalicek
    10  */
    11 public class ExchangeRate {
    12     private BigDecimal numberFor;
    13     private BigDecimal numberGet;
    14 
    15     public  ExchangeRate(BigDecimal fromValue, BigDecimal toValue) {
    16         this.numberFor = fromValue;
    17         this.numberGet = toValue;
    18     }
    19 
    20     @Override
    21     public String toString() {
    22         return "for "+numberFor+" recieve "+numberGet+" @"+getClass().getName();
    23     }
    24     
    25     public BigDecimal getFromValue() {
    26         return numberFor;
    27     }
    28     
    29     public BigDecimal getToValue() {
    30         return numberGet;
    31     }
    32     
    33     
    34 //    public ExchangeRate createExchangeRate(BigDecimal forValue, BigDecimal getValue) {
    35 //        ExchangeRate rate = new ExchangeRate(forValue, getValue);
    36 //        return rate;
    37 //    }
    38     
    39     
    40     
    41 }