task2/solution04/src/org/apidesign/apifest08/currency/Convertor.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Wed, 01 Oct 2008 10:43:05 +0200
changeset 29 f6073056b9fe
parent 17 task1/solution04/src/org/apidesign/apifest08/currency/Convertor.java@37c9921c653e
child 35 8898c620fe96
permissions -rw-r--r--
Getting ready for task2: copying all solutions to new locations
     1 package org.apidesign.apifest08.currency;
     2 
     3 
     4 import java.math.BigDecimal;
     5 import java.util.Currency;
     6 
     7 
     8 /**
     9  * Convert between two currencies.
    10  *
    11  * @author D'Arcy Smith
    12  * @version 1.0
    13  */
    14 public interface Convertor
    15 {
    16     /**
    17      * Convert an amount from one currency to another.
    18      * 
    19      * @param from the currency to convert from.
    20      * @param to the currency to convert to.
    21      * @param amount the amount to convert.
    22      * @return the converted amount.
    23      * @throws IllegalArgumentException if any of the arguments are null.
    24      * @throws InvalidConversionException if either from or to are not valid for the convertor.
    25      */
    26     BigDecimal convert(Currency   from, 
    27                        Currency   to, 
    28                        BigDecimal amount)
    29         throws InvalidConversionException;
    30 }