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-- |
japod@23 | 1 |
|
japod@23 | 2 |
package org.apidesign.apifest08.currency; |
japod@23 | 3 |
|
japod@23 | 4 |
import java.math.BigDecimal; |
japod@23 | 5 |
|
japod@23 | 6 |
/** |
japod@23 | 7 |
* Exchange rate value. Contains <code>from</code> and <code>to</code> value. |
japod@23 | 8 |
* |
japod@23 | 9 |
* @author arnostvalicek |
japod@23 | 10 |
*/ |
japod@23 | 11 |
public class ExchangeRate { |
japod@23 | 12 |
private BigDecimal numberFor; |
japod@23 | 13 |
private BigDecimal numberGet; |
japod@23 | 14 |
|
japod@23 | 15 |
public ExchangeRate(BigDecimal fromValue, BigDecimal toValue) { |
japod@23 | 16 |
this.numberFor = fromValue; |
japod@23 | 17 |
this.numberGet = toValue; |
japod@23 | 18 |
} |
japod@23 | 19 |
|
japod@23 | 20 |
@Override |
japod@23 | 21 |
public String toString() { |
japod@23 | 22 |
return "for "+numberFor+" recieve "+numberGet+" @"+getClass().getName(); |
japod@23 | 23 |
} |
japod@23 | 24 |
|
japod@23 | 25 |
public BigDecimal getFromValue() { |
japod@23 | 26 |
return numberFor; |
japod@23 | 27 |
} |
japod@23 | 28 |
|
japod@23 | 29 |
public BigDecimal getToValue() { |
japod@23 | 30 |
return numberGet; |
japod@23 | 31 |
} |
japod@23 | 32 |
|
japod@23 | 33 |
|
japod@23 | 34 |
// public ExchangeRate createExchangeRate(BigDecimal forValue, BigDecimal getValue) { |
japod@23 | 35 |
// ExchangeRate rate = new ExchangeRate(forValue, getValue); |
japod@23 | 36 |
// return rate; |
japod@23 | 37 |
// } |
japod@23 | 38 |
|
japod@23 | 39 |
|
japod@23 | 40 |
|
japod@23 | 41 |
} |