Android Open Source - SipgateInfo Price






From Project

Back to project page SipgateInfo.

License

The source code is released under:

GNU General Public License

If you think the Android project SipgateInfo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package net.skweez.sipgate.api;
// w  ww  .  j  a  v a  2 s.c  o  m
import java.text.NumberFormat;
import java.util.Currency;

/**
 * 
 * @author mks
 * @author $Author: mks $
 * @version $Rev: 9 $
 * @levd.rating RED Rev:
 */
public class Price {

  /** Formats the money amount as a currency. */
  private final NumberFormat format = NumberFormat.getCurrencyInstance();

  /** Amount of money in Currency that is available at user's account. */
  private final Double amount;

  /** The currency code in ISO 4217 format. */
  private final String currencyString;

  /**
   * @param currency
   *            the currency code in ISO 4217 format.
   * @throws IllegalArgumentException
   *             if the currency code is not a supported ISO 4217 currency
   *             code.
   */
  public Price(Double amount, String currency) {
    this.amount = amount;
    currencyString = currency;
    format.setCurrency(Currency.getInstance(currency));
  }

  /** Returns the amount of money. */
  public Double getAmount() {
    return amount;
  }

  public String getCurrencyString() {
    return currencyString;
  }

  /** {@inheritDoc} */
  @Override
  public String toString() {
    StringBuilder builder = new StringBuilder();
    builder.append(format.format(amount));
    return builder.toString();
  }
}




Java Source Code List

net.skweez.sipgate.CallUtils.java
net.skweez.sipgate.PreferencesAuthenticator.java
net.skweez.sipgate.SipgateApplication.java
net.skweez.sipgate.activity.AccountInfoAdapter.java
net.skweez.sipgate.activity.CallListAdapter.java
net.skweez.sipgate.activity.MainActivity.java
net.skweez.sipgate.activity.SetupActivity.java
net.skweez.sipgate.api.AuthenticationException.java
net.skweez.sipgate.api.Call.java
net.skweez.sipgate.api.ECallStatus.java
net.skweez.sipgate.api.ISipgateAPI.java
net.skweez.sipgate.api.Price.java
net.skweez.sipgate.api.SipgateException.java
net.skweez.sipgate.api.UserName.java
net.skweez.sipgate.api.UserUri.java
net.skweez.sipgate.api.xmlrpc.SipgateUriHelper.java
net.skweez.sipgate.api.xmlrpc.SipgateXmlRpcImpl.java
net.skweez.sipgate.db.DataSource.java
net.skweez.sipgate.db.DatabaseHelper.java
net.skweez.sipgate.model.AccountInfo.java
net.skweez.sipgate.service.QueryResultReceiver.java
net.skweez.sipgate.service.QueryService.java