jp.bitmeister.asn1.type.builtin
Class INTEGER

java.lang.Object
  extended by jp.bitmeister.asn1.type.ASN1Type
      extended by jp.bitmeister.asn1.type.PrimitiveType<T>
          extended by jp.bitmeister.asn1.type.AbstractInteger<java.lang.Long>
              extended by jp.bitmeister.asn1.type.builtin.INTEGER
All Implemented Interfaces:
java.lang.Cloneable, ValueComparable<AbstractInteger<java.lang.Long>>
Direct Known Subclasses:
ENUMERATED

public class INTEGER
extends AbstractInteger<java.lang.Long>

An implementation of ASN.1 'INTEGER' type that contains Long value.

An instance of this class represents an 'INTEGER' type data, and has a Long value. If the data needs to contain value which is bigger than Long.MAX_VALUE or smaller than Long.MIN_VALUE, BigINTEGER type shall be used.

Author:
WATANABE, Jun.
See Also:
BigINTEGER

Field Summary
 
Fields inherited from class jp.bitmeister.asn1.type.ASN1Type
stringBuilder
 
Constructor Summary
INTEGER()
          Instantiates an empty INTEGER.
INTEGER(long value)
          Instantiates an INTEGER and initialize it with the long value.
 
Method Summary
<R,E extends java.lang.Throwable>
R
accept(ASN1Visitor<R,E> visitor)
          Accepts the ASN1Visitor and calls a visit method of the visitor.
 java.util.Map<java.lang.Long,java.lang.String> getNamedNumberMap()
          Returns map of enumerations related to this type.
protected  boolean isEnum()
          Tests if base type of this data is ASN.1 'ENUMERATED'.
 boolean isIntValue()
          Tests if the value of this data is in the range of int value.
 boolean isLongValue()
          Tests if the value of this data is in the range of long value.
 
Methods inherited from class jp.bitmeister.asn1.type.AbstractInteger
compareTo, identifier, intValue, longValue, set, set
 
Methods inherited from class jp.bitmeister.asn1.type.PrimitiveType
clear, clone, cloneValue, hashCode, hasValue, value, valueEquals
 
Methods inherited from class jp.bitmeister.asn1.type.ASN1Type
equals, instantiate, matches, specification, toString, validate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

INTEGER

public INTEGER()
Instantiates an empty INTEGER.


INTEGER

public INTEGER(long value)
Instantiates an INTEGER and initialize it with the long value.

Parameters:
value - The value to be assigned.
Method Detail

getNamedNumberMap

public java.util.Map<java.lang.Long,java.lang.String> getNamedNumberMap()
Description copied from class: AbstractInteger
Returns map of enumerations related to this type.

Specified by:
getNamedNumberMap in class AbstractInteger<java.lang.Long>
Returns:
The map of enumerations.

accept

public <R,E extends java.lang.Throwable> R accept(ASN1Visitor<R,E> visitor)
         throws E extends java.lang.Throwable
Description copied from class: ASN1Type
Accepts the ASN1Visitor and calls a visit method of the visitor.

Specified by:
accept in class ASN1Type
Parameters:
visitor - The visitor.
Returns:
Result.
Throws:
E - When an error occurred in the visit method of the visitor.
E extends java.lang.Throwable

isLongValue

public boolean isLongValue()
Description copied from class: AbstractInteger
Tests if the value of this data is in the range of long value.

Specified by:
isLongValue in class AbstractInteger<java.lang.Long>
Returns:
true when the value of this data is in the range of long.

isIntValue

public boolean isIntValue()
Description copied from class: AbstractInteger
Tests if the value of this data is in the range of int value.

Specified by:
isIntValue in class AbstractInteger<java.lang.Long>
Returns:
true when the value of this data is in the range of int.

isEnum

protected boolean isEnum()
Description copied from class: AbstractInteger
Tests if base type of this data is ASN.1 'ENUMERATED'.

Specified by:
isEnum in class AbstractInteger<java.lang.Long>
Returns:
true if base type of this data is ASN.1 'ENUMERATED'.


Copyright © 2012 BitMeister Inc. All Rights Reserved.