task1/solution13/src/org/apidesign/apifest08/currency/ExchangeRate.java
author japod@localhost
Tue, 30 Sep 2008 13:42:03 +0200
changeset 23 f4b4f95ae1bd
permissions -rw-r--r--
adding solution 13
     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 }