task4/solution12/src/org/apidesign/apifest08/currency/ExchangeRate.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Fri, 17 Oct 2008 17:39:18 +0200
changeset 68 4de3a4b5445a
parent 61 58ec6da75f6f
permissions -rw-r--r--
solution 12, task4
     1 package org.apidesign.apifest08.currency;
     2 
     3 import java.util.Currency;
     4 import java.util.Date;
     5 
     6 public class ExchangeRate {
     7 
     8   private Currency originalCurrency;
     9   private Currency newCurrency;
    10   private double unit;
    11   private double rate;
    12   private Date validFrom;
    13   private Date validTo;
    14 
    15   public ExchangeRate(Currency originalCurrency, Currency newCurrency, double rate, double unit) {
    16     this.newCurrency = newCurrency;
    17     this.originalCurrency = originalCurrency;
    18     this.rate = rate;
    19     this.unit = unit;
    20   }
    21   
    22   public ExchangeRate(Currency originalCurrency, Currency newCurrency, double rate, double unit, Date validFrom, Date validTo) {
    23     this.newCurrency = newCurrency;
    24     this.originalCurrency = originalCurrency;
    25     this.rate = rate;
    26     this.unit = unit;
    27     this.validFrom = validFrom;
    28     this.validTo = validTo;
    29   }
    30 
    31   /**
    32    * @return the originalCurrency
    33    */
    34   public Currency getOriginalCurrency() {
    35     return originalCurrency;
    36   }
    37 
    38   /**
    39    * @return the newCurrency
    40    */
    41   public Currency getNewCurrency() {
    42     return newCurrency;
    43   }
    44 
    45   /**
    46    * @return the unit
    47    */
    48   public double getUnit() {
    49     return unit;
    50   }
    51 
    52   /**
    53    * @param unit the unit to set
    54    */
    55   public void setUnit(double unit) {
    56     this.unit = unit;
    57   }
    58 
    59   /**
    60    * @return the rate
    61    */
    62   public double getRate() {
    63     return rate;
    64   }
    65 
    66   /**
    67    * @param rate the rate to set
    68    */
    69   public void setRate(double rate) {
    70     this.rate = rate;
    71   }
    72 
    73   /**
    74    * @return the validFrom
    75    */
    76   public Date getValidFrom() {
    77     return validFrom;
    78   }
    79 
    80   /**
    81    * @param validFrom the validFrom to set
    82    */
    83   public void setValidFrom(Date validFrom) {
    84     this.validFrom = validFrom;
    85   }
    86 
    87   /**
    88    * @return the validTo
    89    */
    90   public Date getValidTo() {
    91     return validTo;
    92   }
    93 
    94   /**
    95    * @param validTo the validTo to set
    96    */
    97   public void setValidTo(Date validTo) {
    98     this.validTo = validTo;
    99   }
   100 
   101 }