jp.bitmeister.asn1.type
Class PrimitiveType<T>

java.lang.Object
  extended by jp.bitmeister.asn1.type.ASN1Type
      extended by jp.bitmeister.asn1.type.PrimitiveType<T>
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
ANY, BIT_STRING, BOOLEAN, INTEGER, NULL, OBJECT_IDENTIFIER, OCTET_STRING, REAL

public abstract class PrimitiveType<T>
extends ASN1Type

The base class for primitive ASN.1 types.

This class provides common methods and a value field for classes which represents simple, unconstructive ASN.1 types.

Author:
WATANABE, Jun.

Field Summary
 
Fields inherited from class jp.bitmeister.asn1.type.ASN1Type
stringBuilder
 
Constructor Summary
PrimitiveType()
           
 
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.
protected  T cloneValue()
          Creates and returns a copy of the value set to this 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(T value)
          Sets the value to this data.
 T value()
          Returns the value set to this data.
 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, validate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrimitiveType

public PrimitiveType()
Method Detail

set

public void set(T value)
Sets the value to this data.

Parameters:
value - The value to be set.

value

public T value()
Returns the value set to this data.

Returns:
The value.

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.

cloneValue

protected T cloneValue()
Creates and returns a copy of the value set to this data.

Returns:
A copy of the 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()


Copyright © 2012 BitMeister Inc. All Rights Reserved.