Package com.oss.asn1
Class AbstractObjectIdentifier
java.lang.Object
com.oss.asn1.AbstractData
com.oss.asn1.AbstractObjectIdentifier
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
ObjectIdentifier
,RelativeObjectIdentifier
The AbstractObjectIdentifier class is a common superclass for the
representations of the ASN.1 OBJECT IDENTIFIER and RELATIVE-OID types.
- Since:
- ASN.1/Java 6.0
- See Also:
-
Field Summary
Fields inherited from class com.oss.asn1.AbstractData
EQUALS, GREATER_THAN, LESS_THAN
-
Constructor Summary
ConstructorsConstructorDescriptionThe default constructor.AbstractObjectIdentifier
(byte[] value) Construct from a byte array.AbstractObjectIdentifier
(String valueNotation, boolean relative) Construct from a String. -
Method Summary
Modifier and TypeMethodDescriptionfinal byte[]
Get the value of 'this' object as a byte arrayclone()
Clone 'this' object.void
delete()
Destroy the instance of the AbstractData.int
hashCode()
Returns a hash code for this objectfinal void
setValue
(byte[] value) Set the value of 'this' object to a byte array.Methods inherited from class com.oss.asn1.AbstractData
abstractEqualTo, equals, getTypeName, isEncodable, isPDU, isValid, toString, toString
-
Constructor Details
-
AbstractObjectIdentifier
public AbstractObjectIdentifier()The default constructor. -
AbstractObjectIdentifier
public AbstractObjectIdentifier(String valueNotation, boolean relative) throws BadObjectIdentifierException Construct from a String. The String can contain ASN.1 Value Notation in the format:"{ 1 2 3 4 5 6 7 }"
or in the format"1.2.3.4.5.6.7"
. With the first format, the blanks after the '{' and before the '}' are optional. If the string has some extra characters before the '{' or after the '}', they are simply ignored.- Parameters:
valueNotation
- the value to set this object's value to.relative
- indicates if the OID being constructed is a relative object identifier.- Throws:
BadObjectIdentifierException
- thrown if the String parameter does not contain valid ASN.1 Value Notation
-
AbstractObjectIdentifier
public AbstractObjectIdentifier(byte[] value) Construct from a byte array.- Parameters:
value
- the byte array value to set 'this' object to.
-
-
Method Details
-
setValue
public final void setValue(byte[] value) Set the value of 'this' object to a byte array.- Parameters:
value
- the byte array value to set 'this' object to.
-
byteArrayValue
public final byte[] byteArrayValue()Get the value of 'this' object as a byte array- Returns:
- value of this object as the array of bytes.
-
clone
Clone 'this' object.- Returns:
- deep copy of 'this' object.
-
delete
public void delete()Destroy the instance of the AbstractData. The contract of this method is to facilitate garbage collection by explicit destruction of the data that is no longer needed.- Overrides:
delete
in classAbstractData
-
hashCode
public int hashCode()Returns a hash code for this object- Overrides:
hashCode
in classAbstractData
- Returns:
- a hash code for this object
-