jp.bitmeister.asn1.type
Class UnknownType

java.lang.Object
  extended by jp.bitmeister.asn1.type.ASN1Type
      extended by jp.bitmeister.asn1.type.UnknownType
All Implemented Interfaces:
java.lang.Cloneable

public final class UnknownType
extends ASN1Type

Represents a type that does not have definition.

When a decoder meets a source data with a tag that is not registered to ASN1ModuleManager, decoder decodes the data as an UnknownType. An instance of this class contains a tag class, a tag number and an array of byte represents row contents octets.

Author:
WATANABE, Jun.
See Also:
ASN1ModuleManager, BerDecoder

Field Summary
 
Fields inherited from class jp.bitmeister.asn1.type.ASN1Type
stringBuilder
 
Constructor Summary
UnknownType(ASN1TagClass tagClass, int tagNumber)
          Instantiate with a tag class and a tag number.
 
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.
 void clear()
          Clears the value of this ASN.1 data.
 java.lang.Object clone()
          Creates and returns a copy of this ASN.1 data.
 int hashCode()
          Returns a hash code value for this ASN.1 data.
 boolean hasValue()
          Tests if this ASN.1 data has value.
 void set(byte[] value)
          Set contents octets.
 ASN1TagClass tagClass()
          Returns tag class.
 int tagNumber()
          Returns tag number.
 byte[] value()
          Returns contents octets.
 boolean valueEquals(java.lang.Object other)
          Tests if the value of this ASN.1 data equals the value of the other ASN.1 data.
 
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

UnknownType

public UnknownType(ASN1TagClass tagClass,
                   int tagNumber)
Instantiate with a tag class and a tag number.

Parameters:
tagClass - ASN.1 tag class.
tagNumber - ASN.1 tag number.
Method Detail

set

public void set(byte[] value)
Set contents octets.

Parameters:
value - The contents octets.

value

public byte[] value()
Returns contents octets.

Returns:
The contents octets.

tagClass

public ASN1TagClass tagClass()
Returns tag class.

Returns:
The ASN.1 tag class.

tagNumber

public int tagNumber()
Returns tag number.

Returns:
The ASN.1 tag number.

clear

public void clear()
Description copied from class: ASN1Type
Clears the value of this ASN.1 data.

Specified by:
clear in class ASN1Type

hasValue

public boolean hasValue()
Description copied from class: ASN1Type
Tests if this ASN.1 data has value.

Specified by:
hasValue in class ASN1Type
Returns:
true when this ASN.1 data has value.

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 occured in the visit method of the visitor.
E extends java.lang.Throwable

valueEquals

public boolean valueEquals(java.lang.Object other)
Description copied from class: ASN1Type
Tests if the value of this ASN.1 data equals the value of the other ASN.1 data. This method returns true when they have same value even if their types are different.

Specified by:
valueEquals in class ASN1Type
Parameters:
other - The ASN.1 data which to be compared.
Returns:
true when they have same value.

hashCode

public int hashCode()
Description copied from class: ASN1Type
Returns a hash code value for this ASN.1 data.

Specified by:
hashCode in class ASN1Type
See Also:
Object.hashCode()

clone

public java.lang.Object clone()
Description copied from class: ASN1Type
Creates and returns a copy of this ASN.1 data. This method performs a 'deep copy' operation.

Specified by:
clone in class ASN1Type
See Also:
Object.clone()


Copyright © 2012 BitMeister Inc. All Rights Reserved.