Ejemplo n.º 1
0
 /**
  * Returns the specified currency's value.
  *
  * @param currency
  * @throws NoCurrencyException
  * @return Currency value
  */
 public static double getCurrencyValue(String currency) {
   if (Currency.exists(currency)) {
     return Currency.getValue(currency);
   } else {
     throw new NoCurrencyException(
         "MCCom: public static double getCurrencyValue(String currency)", "currency");
   }
 }
Ejemplo n.º 2
0
 /**
  * Sets the specified currency of the specified account.
  *
  * @param account
  * @param currency
  * @throws NoAccountException
  * @throws NoCurrencyException
  */
 public static void setAccountCurrency(String account, String currency) {
   if (Currency.exists(currency)) {
     //	        if (accounting.exists(account))
     //	        {
     accounting.setCurrency(
         getAccount(
             account, "MCCom: public static void setCurrency(String account, String currency)"),
         currency);
     //	        }
     //	        else
     //	        {
     //	            throw new NoAccountException("MCCom: public static void setCurrency(String
     // account, String currency)", "account");
     //	        }
   } else {
     throw new NoCurrencyException(
         "MCCom: public static void setCurrency(String account, String currency)", "currency");
   }
 }
Ejemplo n.º 3
0
 /**
  * Returns true if the specified currency exists.
  *
  * @param currency
  * @return True if the specified currency exists.
  */
 public static boolean currencyExists(String currency) {
   return Currency.exists(currency);
 }