2 * Copyright 2011 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.ASN1Tag;
23 import jp.bitmeister.asn1.processor.ASN1Visitor;
24 import jp.bitmeister.asn1.type.ASN1TagClass;
25 import jp.bitmeister.asn1.type.ASN1TagMode;
28 * Represents ASN.1 'ENUMERATED' type.
31 * This is the base class used for defining 'ENUMERATED' types. A sub-class of
32 * {@code ENUMERATED} must contain one or more fields annotated as
33 * {@code @ASN1Enumeration}.
36 * @author WATANABE, Jun. <jwat at bitmeister.jp>
38 * @see ASN1Enumeration
41 @ASN1Tag(tagClass = ASN1TagClass.UNIVERSAL, value = 10, tagMode = ASN1TagMode.IMPLICIT)
42 public abstract class ENUMERATED extends INTEGER {
45 * Instantiates an empty {@code ENUMERATED}.
51 * Instantiates an {@code ENUMERATED} and initialize it with the
52 * {@code BigInteger} value.
55 * The value to be assigned.
57 public ENUMERATED(BigInteger value) {
62 * Instantiates an {@code ENUMERATED} and initialize it with the {@code long}
66 * The value to be assigned.
68 public ENUMERATED(long value) {
76 * jp.bitmeister.asn1.type.builtin.INTEGER#accept(jp.bitmeister.asn1.processor
80 public <R, E extends Throwable> R accept(ASN1Visitor<R, E> visitor) throws E {
81 return visitor.visit(this);