Package de.cardcontact.tlv
Class IntegerTLV
- java.lang.Object
-
- de.cardcontact.tlv.TLV
-
- de.cardcontact.tlv.PrimitiveTLV
-
- de.cardcontact.tlv.IntegerTLV
-
- All Implemented Interfaces:
TreeNode
public class IntegerTLV extends PrimitiveTLV
-
-
Field Summary
-
Fields inherited from class de.cardcontact.tlv.PrimitiveTLV
value
-
Fields inherited from class de.cardcontact.tlv.TLV
alternateLengthFormat, name, tag
-
-
Constructor Summary
Constructors Constructor Description IntegerTLV(long val)
Create integer tlv objectIntegerTLV(ParseBuffer pb)
Create integer from binary presentationIntegerTLV(TLV tlv)
Copy constructor to convert PrimitiveTLV to typed object Make sure, that the parent is updated with the new referenceIntegerTLV(java.math.BigInteger bi)
Create integer tlv object
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.math.BigInteger
getBigInteger()
Return value as BigInteger objectstatic IntegerTLV
getInstance(TLV tlv)
Convert - if needed - the PrimitiveTLV to a IntegerTLVstatic IntegerTLV
getInstance(TLV tlv, Tag et)
Check tag and convert - if needed - the PrimitiveTLV to a IntegerTLVlong
getLong()
Return value as signed integer The value field must not exceed 8 bytes, otherwise a UnsupportedOperationException is raised.-
Methods inherited from class de.cardcontact.tlv.PrimitiveTLV
dump, equals, getChildAt, getChildCount, getDate, getIndex, getLength, getParent, getValue, hashCode, isLeaf, toByteArray, toString, valueToByteArray
-
Methods inherited from class de.cardcontact.tlv.TLV
dump, dumpSingleLine, factory, factory, factory, getBytes, getLengthFieldAsByteArray, getLengthFieldSize, getLengthFieldSizeHelper, getName, getSize, getTag, lengthFromByteArray, lengthToByteArray, setName, setTag, useAlternateLengthEncoding
-
-
-
-
Constructor Detail
-
IntegerTLV
public IntegerTLV(long val)
Create integer tlv object- Parameters:
value
- the value part of the TLV object as signed long
-
IntegerTLV
public IntegerTLV(java.math.BigInteger bi)
Create integer tlv object- Parameters:
value
- the value part of the TLV object as BigInteger
-
IntegerTLV
public IntegerTLV(ParseBuffer pb) throws TLVEncodingException
Create integer from binary presentation- Parameters:
pb
- Buffer with binary presentation- Throws:
TLVEncodingException
-
IntegerTLV
public IntegerTLV(TLV tlv) throws TLVEncodingException
Copy constructor to convert PrimitiveTLV to typed object Make sure, that the parent is updated with the new reference- Parameters:
tlv
- the PrimitiveTLV object- Throws:
TLVEncodingException
-
-
Method Detail
-
getInstance
public static IntegerTLV getInstance(TLV tlv, Tag et) throws TLVEncodingException
Check tag and convert - if needed - the PrimitiveTLV to a IntegerTLV- Parameters:
tlv
-- Returns:
- Throws:
TLVEncodingException
-
getInstance
public static IntegerTLV getInstance(TLV tlv) throws TLVEncodingException
Convert - if needed - the PrimitiveTLV to a IntegerTLV- Parameters:
tlv
-et
- et tag used in implicit encoding- Throws:
TLVEncodingException
-
getBigInteger
public java.math.BigInteger getBigInteger()
Return value as BigInteger object- Returns:
- the valus as BigInteger
-
getLong
public long getLong()
Return value as signed integer The value field must not exceed 8 bytes, otherwise a UnsupportedOperationException is raised.- Returns:
- the value field converted to a signed integer
-
-