1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/task2/solution13/src/org/apidesign/apifest08/currency/ExchangeRate.java Wed Oct 01 10:43:05 2008 +0200
1.3 @@ -0,0 +1,41 @@
1.4 +
1.5 +package org.apidesign.apifest08.currency;
1.6 +
1.7 +import java.math.BigDecimal;
1.8 +
1.9 +/**
1.10 + * Exchange rate value. Contains <code>from</code> and <code>to</code> value.
1.11 + *
1.12 + * @author arnostvalicek
1.13 + */
1.14 +public class ExchangeRate {
1.15 + private BigDecimal numberFor;
1.16 + private BigDecimal numberGet;
1.17 +
1.18 + public ExchangeRate(BigDecimal fromValue, BigDecimal toValue) {
1.19 + this.numberFor = fromValue;
1.20 + this.numberGet = toValue;
1.21 + }
1.22 +
1.23 + @Override
1.24 + public String toString() {
1.25 + return "for "+numberFor+" recieve "+numberGet+" @"+getClass().getName();
1.26 + }
1.27 +
1.28 + public BigDecimal getFromValue() {
1.29 + return numberFor;
1.30 + }
1.31 +
1.32 + public BigDecimal getToValue() {
1.33 + return numberGet;
1.34 + }
1.35 +
1.36 +
1.37 +// public ExchangeRate createExchangeRate(BigDecimal forValue, BigDecimal getValue) {
1.38 +// ExchangeRate rate = new ExchangeRate(forValue, getValue);
1.39 +// return rate;
1.40 +// }
1.41 +
1.42 +
1.43 +
1.44 +}