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

Iso4217CurrencyCode

public class Iso4217CurrencyCode extends org.bouncycastle.asn1.ASN1Encodable implements org.bouncycastle.asn1.ASN1Choice
The Iso4217CurrencyCode object.
Iso4217CurrencyCode ::= CHOICE {
alphabetic PrintableString (SIZE 3), --Recommended
numeric INTEGER (1..999) }
-- Alphabetic or numeric currency code as defined in ISO 4217
-- It is recommended that the Alphabetic form is used

Fields Summary
final int
ALPHABETIC_MAXSIZE
final int
NUMERIC_MINSIZE
final int
NUMERIC_MAXSIZE
org.bouncycastle.asn1.DEREncodable
obj
int
numeric
Constructors Summary
public Iso4217CurrencyCode(int numeric)

        if (numeric > NUMERIC_MAXSIZE || numeric < NUMERIC_MINSIZE)
        {
            throw new IllegalArgumentException("wrong size in numeric code : not in (" +NUMERIC_MINSIZE +".."+ NUMERIC_MAXSIZE +")");
        }
        obj = new DERInteger(numeric);
    
public Iso4217CurrencyCode(String alphabetic)

        if (alphabetic.length() > ALPHABETIC_MAXSIZE)
        {
            throw new IllegalArgumentException("wrong size in alphabetic code : max size is " + ALPHABETIC_MAXSIZE);
        }
        obj = new DERPrintableString(alphabetic);
    
Methods Summary
public java.lang.StringgetAlphabetic()

        return ((DERPrintableString)obj).getString();
    
public static org.bouncycastle.asn1.x509.qualified.Iso4217CurrencyCodegetInstance(java.lang.Object obj)

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

        if (obj instanceof DERInteger)
        {
            DERInteger numericobj = DERInteger.getInstance(obj);
            int numeric = numericobj.getValue().intValue();  
            return new Iso4217CurrencyCode(numeric);            
        }
        else
        if (obj instanceof DERPrintableString)
        {
            DERPrintableString alphabetic = DERPrintableString.getInstance(obj);
            return new Iso4217CurrencyCode(alphabetic.getString());
        }
        throw new IllegalArgumentException("unknown object in getInstance");
    
public intgetNumeric()

        return ((DERInteger)obj).getValue().intValue();
    
public booleanisAlphabetic()

        return obj instanceof DERPrintableString;
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()

    
        return obj.getDERObject();