jp.bitmeister.asn1.type
Class ConstructiveType

java.lang.Object
  extended by jp.bitmeister.asn1.type.ASN1Type
      extended by jp.bitmeister.asn1.type.StructuredType
          extended by jp.bitmeister.asn1.type.ConstructiveType
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
SEQUENCE, SET

public abstract class ConstructiveType
extends StructuredType

The base class for structured types defined by referencing a list of ASN.1 types.

This class provides generic interfaces and common methods for classes that represents structured types which defined by referencing a list of ASN.1 types. This class is the parent class of SEQUENCE and SET.

Author:
WATANABE, Jun.
See Also:
SEQUENCE, SET

Field Summary
 
Fields inherited from class jp.bitmeister.asn1.type.ASN1Type
stringBuilder
 
Constructor Summary
ConstructiveType()
           
 
Method Summary
 void clear()
          Clears the value of this ASN.1 data.
 java.lang.Object clone()
          Creates and returns a copy of this ASN.1 data.
 ASN1Type get(java.lang.String elementName)
          Gets the ASN.1 data from the element specified by the identifier of this instance.
 ASN1Type getComponent(ElementSpecification element)
          Returns the ASN.1 data that assigned to the element of this instance.
 NamedTypeSpecification getElement(java.lang.String elementName)
          Returns an element specification specified by the element name.
 ElementSpecification[] getElementTypeList()
          Returns the array of ElementSpecification that associated to the elements contained in the type.
 int hashCode()
          Returns a hash code value for this ASN.1 data.
 boolean hasValue()
          Tests if this ASN.1 data has value.
 void set(NamedTypeSpecification component, ASN1Type data)
          Sets the ASN.1 data to the element specified by the NamedTypeSpecification of this instance.
 void set(java.lang.String elementName, ASN1Type component)
          Sets the ASN.1 data to the element specified by the identifier of this instance.
 void validate()
          Tests if this ASN.1 data has valid value.
 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
accept, equals, instantiate, matches, specification, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstructiveType

public ConstructiveType()
Method Detail

getElementTypeList

public ElementSpecification[] getElementTypeList()
Returns the array of ElementSpecification that associated to the elements contained in the type.

Returns:
The array of ElementSpecification.

getComponent

public ASN1Type getComponent(ElementSpecification element)
Returns the ASN.1 data that assigned to the element of this instance.

Parameters:
element - The ElementSpecification associated to the element.
Returns:
The ASN.1 data.

set

public void set(NamedTypeSpecification component,
                ASN1Type data)
Description copied from class: StructuredType
Sets the ASN.1 data to the element specified by the NamedTypeSpecification of this instance.

Specified by:
set in class StructuredType
Parameters:
component - Indicates the element that the data to be assigned.
data - The data to be assigned.

set

public void set(java.lang.String elementName,
                ASN1Type component)
Description copied from class: StructuredType
Sets the ASN.1 data to the element specified by the identifier of this instance.

Specified by:
set in class StructuredType
Parameters:
elementName - The identifier of element.
component - The ASN.1 data to be assigned

get

public ASN1Type get(java.lang.String elementName)
Description copied from class: StructuredType
Gets the ASN.1 data from the element specified by the identifier of this instance.

Specified by:
get in class StructuredType
Parameters:
elementName - The identifier of element.
Returns:
The ASN.1 data of the element.

getElement

public NamedTypeSpecification getElement(java.lang.String elementName)
Description copied from class: StructuredType
Returns an element specification specified by the element name.

Specified by:
getElement in class StructuredType
Parameters:
elementName - The element name.
Returns:
The element specification specified by the name.

validate

public void validate()
Description copied from class: ASN1Type
Tests if this ASN.1 data has valid value.

Overrides:
validate in class ASN1Type

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.

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()