jp.bitmeister.asn1.type.builtin
Class ENUMERATED

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
                  extended by jp.bitmeister.asn1.type.builtin.ENUMERATED
All Implemented Interfaces:
java.lang.Cloneable, ValueComparable<AbstractInteger<java.lang.Long>>

public abstract class ENUMERATED
extends INTEGER

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

This is the base class used for defining 'ENUMERATED' types, 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, BigENUMERATED type shall be used. A sub-class of ENUMERATED must contain one or more fields annotated as @ASN1Enumeration.

Author:
WATANABE, Jun.
See Also:
ASN1Enumeration, BigENUMERATED

Field Summary
 
Fields inherited from class jp.bitmeister.asn1.type.ASN1Type
stringBuilder
 
Constructor Summary
ENUMERATED()
          Instantiates an empty ENUMERATED.
ENUMERATED(long value)
          Instantiates an ENUMERATED 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.
protected  boolean isEnum()
          Tests if base type of this data is ASN.1 'ENUMERATED'.
 
Methods inherited from class jp.bitmeister.asn1.type.builtin.INTEGER
getNamedNumberMap, isIntValue, isLongValue
 
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

ENUMERATED

public ENUMERATED()
Instantiates an empty ENUMERATED.


ENUMERATED

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

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

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.

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

isEnum

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

Overrides:
isEnum in class INTEGER
Returns:
true if base type of this data is ASN.1 'ENUMERATED'.


Copyright © 2012 BitMeister Inc. All Rights Reserved.