|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.demac.impl.j2me.process.base.service.webservices.asn1.ASN1AbstractType
org.demac.impl.j2me.process.base.service.webservices.asn1.ASN1Integer
public class ASN1Integer
Represents an ASN.1 INTEGER type. The corresponding Java type is java.math.BigInteger.
Constructor Summary | |
---|---|
ASN1Integer()
Creates a new instance ready for parsing. |
|
ASN1Integer(java.math.BigInteger val)
Creates a new instance with the given BigInteger as its initial value. |
|
ASN1Integer(byte[] val)
Creates a new instance from the given byte array. |
|
ASN1Integer(int n)
Creates an instance with the given int value. |
|
ASN1Integer(int signum,
byte[] magnitude)
Translates the sign-magnitude representation of a BigInteger into an ASN.1 INTEGER. |
|
ASN1Integer(java.lang.String val)
Creates an ASN.1 INTEGER from the given string representation. |
Method Summary | |
---|---|
void |
decode(Decoder dec)
|
void |
encode(Encoder enc)
|
java.math.BigInteger |
getBigInteger()
|
int |
getTag()
Returns the corresponding ASN.1 tag. |
java.lang.Object |
getValue()
This abstract method should return the value wrapped by the ASN1Type. |
void |
setBigInteger(java.math.BigInteger n)
|
java.lang.String |
toString()
|
Methods inherited from class org.demac.impl.j2me.process.base.service.webservices.asn1.ASN1AbstractType |
---|
checkConstraints, getConstraint, getTagClass, isExplicit, isOptional, isType, readExternal, setConstraint, setExplicit, setOptional, writeExternal |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ASN1Integer()
public ASN1Integer(java.math.BigInteger val)
val
- The value.public ASN1Integer(java.lang.String val) throws java.lang.NumberFormatException
java.math.BigInteger
.
val
- The string representation of the multiple precision
integer.
java.lang.NumberFormatException
- if the string could not be parsed successfully.public ASN1Integer(byte[] val) throws java.lang.NumberFormatException
java.math.BigInteger
.
val
- The two's-complement input number in big endian
byte-order.
java.lang.NumberFormatException
- if val is zero bytes long.public ASN1Integer(int signum, byte[] magnitude) throws java.lang.NumberFormatException
This method calls the equivalent constructor of class
java.math.BigInteger
.
signum
- signum of the number (-1 for negative, 0 for zero, 1 for
positive).magnitude
- The big endian binary representation of the magnitude of
the number.
java.lang.NumberFormatException
- signum is not one of the three legal values (-1, 0, and
1), or signum is 0 and magnitude contains one or more
non-zero bytes.public ASN1Integer(int n)
n
- The integer to initialize with.Method Detail |
---|
public java.lang.Object getValue()
ASN1AbstractType
getValue
in interface ASN1Type
getValue
in class ASN1AbstractType
public java.math.BigInteger getBigInteger()
public void setBigInteger(java.math.BigInteger n) throws ConstraintException
ConstraintException
public int getTag()
ASN1AbstractType
getTag
in interface ASN1Type
getTag
in class ASN1AbstractType
public void encode(Encoder enc) throws ASN1Exception, java.io.IOException
encode
in interface ASN1Type
encode
in class ASN1AbstractType
ASN1Exception
java.io.IOException
public void decode(Decoder dec) throws ASN1Exception, java.io.IOException
decode
in interface ASN1Type
decode
in class ASN1AbstractType
ASN1Exception
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |