2 * Copyright 2011-2012 BitMeister Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package jp.bitmeister.asn1.type.builtin;
18 import java.math.BigInteger;
20 import jp.bitmeister.asn1.annotation.ASN1BuiltIn;
21 import jp.bitmeister.asn1.annotation.ASN1Enumeration;
22 import jp.bitmeister.asn1.annotation.ASN1Identifier;
23 import jp.bitmeister.asn1.annotation.ASN1Tag;
24 import jp.bitmeister.asn1.processor.ASN1Visitor;
25 import jp.bitmeister.asn1.type.ASN1TagClass;
26 import jp.bitmeister.asn1.type.ASN1TagMode;
29 * An implementation of ASN.1 'ENUMERATED' type that can contain
30 * arbitrary-precision integer value.
33 * This is the base class used for defining 'ENUMERATED' types which need to
34 * contain an arbitrary-precision value. A sub-class of {@code BigENUMERATED}
35 * must contain one or more fields annotated as {@code @ASN1Enumeration}.
38 * @author WATANABE, Jun. <jwat at bitmeister.jp>
40 * @see ASN1Enumeration
44 @ASN1Identifier("ENUMERATED")
45 @ASN1Tag(tagClass = ASN1TagClass.UNIVERSAL, value = 10, tagMode = ASN1TagMode.IMPLICIT)
46 public abstract class BigENUMERATED extends BigINTEGER {
49 * Instantiates an empty {@code BigENUMERATED}.
51 public BigENUMERATED() {
55 * Instantiates an {@code BigENUMERATED} and initialize it with the
56 * {@code BigInteger} value.
59 * The value to be assigned.
61 public BigENUMERATED(BigInteger value) {
66 * Instantiates an {@code BigENUMERATED} and initialize it with the {@code long}
70 * The value to be assigned.
72 public BigENUMERATED(long value) {
77 * Instantiates an {@code BigENUMERATED} and initialize it with the value that is
78 * specified by the identifier of namednumber.
81 * Identifier of the number to be assigned.
83 public BigENUMERATED(String identifier) {
91 * jp.bitmeister.asn1.type.builtin.INTEGER#accept(jp.bitmeister.asn1.processor
95 public <R, E extends Throwable> R accept(ASN1Visitor<R, E> visitor) throws E {
96 return visitor.visit(this);
102 * @see jp.bitmeister.asn1.type.AbstractInteger#isEnum()
105 protected boolean isEnum() {