FileDocCategorySizeDatePackage
MonetaryValue.javaAPI DocAndroid 1.5 API2452Wed May 06 22:41:06 BST 2009org.bouncycastle.asn1.x509.qualified

MonetaryValue

public class MonetaryValue extends org.bouncycastle.asn1.ASN1Encodable
The MonetaryValue object.
MonetaryValue ::= SEQUENCE {
currency Iso4217CurrencyCode,
amount INTEGER,
exponent INTEGER }
-- value = amount * 10^exponent

Fields Summary
Iso4217CurrencyCode
currency
org.bouncycastle.asn1.DERInteger
amount
org.bouncycastle.asn1.DERInteger
exponent
Constructors Summary
public MonetaryValue(org.bouncycastle.asn1.ASN1Sequence seq)

        Enumeration e = seq.getObjects();    
        // currency
        currency = Iso4217CurrencyCode.getInstance(e.nextElement());
        // hashAlgorithm
        amount = DERInteger.getInstance(e.nextElement());
        // exponent
        exponent = DERInteger.getInstance(e.nextElement());            
    
public MonetaryValue(Iso4217CurrencyCode currency, int amount, int exponent)

    
        this.currency = currency;
        this.amount = new DERInteger(amount);
        this.exponent = new DERInteger(exponent);                  
    
Methods Summary
public java.math.BigIntegergetAmount()

        return amount.getValue();
    
public Iso4217CurrencyCodegetCurrency()

        return currency;
    
public java.math.BigIntegergetExponent()

        return exponent.getValue();
    
public static org.bouncycastle.asn1.x509.qualified.MonetaryValuegetInstance(java.lang.Object obj)

        if (obj == null || obj instanceof MonetaryValue)
        {
            return (MonetaryValue)obj;
        }

        if (obj instanceof ASN1Sequence)
        {
            return new MonetaryValue(ASN1Sequence.getInstance(obj));            
        }
        
        throw new IllegalArgumentException("unknown object in getInstance");
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()

        ASN1EncodableVector seq = new ASN1EncodableVector();
        seq.add(currency);
        seq.add(amount);
        seq.add(exponent); 
        
        return new DERSequence(seq);