Package com.oss.asn1
Class Enumerated
java.lang.Object
com.oss.asn1.AbstractData
com.oss.asn1.Enumerated
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
RelaySafeEnumerated
The Enumerated class represents the ASN.1 ENUMERATED type.
- Since:
- ASN.1/Java 6.0
- See Also:
-
Field Summary
Fields inherited from class com.oss.asn1.AbstractData
EQUALS, GREATER_THAN, LESS_THAN
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Clone 'this' object.final int
compareTo
(Enumerated that) Compare 'this' object to 'that' Enumerated object to determine whether the contents of 'this' object is less than, equal to, or greater than the contents of 'that' object.final boolean
equalTo
(Enumerated that) Compare 'this' object to 'that' Enumerated object to see if their contents are the same.Returns the name of ASN.1 type this java class represents.int
hashCode()
Returns a hash code for this objectboolean
Checks if the object is the result of decoding an unknown enumerated value of extensible enumerated type.final long
Get the value of 'this' object.name()
Returns the name of this enumerator.Methods inherited from class com.oss.asn1.AbstractData
delete, equals, isEncodable, isPDU, isValid, toString, toString
-
Method Details
-
longValue
public final long longValue()Get the value of 'this' object.- Returns:
- long value of 'this' object.
-
equalTo
Compare 'this' object to 'that' Enumerated object to see if their contents are the same. Both objects must be ASN.1 assignment compatible or an exception occurs.- Parameters:
that
- the Enumerated object to compare 'this' object to.- Returns:
- true if contents of both objects are the same.
- Throws:
ClassCastException
- if 'that' is non-null and is not assignment compatible with this class.
-
compareTo
Compare 'this' object to 'that' Enumerated object to determine whether the contents of 'this' object is less than, equal to, or greater than the contents of 'that' object. Both objects must be ASN.1 assignment compatible or an exception occurs.- Parameters:
that
- Enumerated object that is compared with 'this' object- Returns:
- LESS_THAN, EQUALS, GREATER_THAN values as the results of comparison.
- Throws:
ClassCastException
- if 'that' is non-null and is not assignment compatible with this class.
-
clone
Clone 'this' object. Enumerated clone simply returns 'this' object, no additional instances get created.- Returns:
- 'this'.
-
isUnknownEnumerator
public boolean isUnknownEnumerator()Checks if the object is the result of decoding an unknown enumerated value of extensible enumerated type. The method must be overridden by subclasses which represent extensible enumerated types. This method simply returns 'false' for non-extensible types.- Returns:
- false
-
name
Returns the name of this enumerator. Returns the name of the enumerator or null if the instance represents unknown enumerator.- Returns:
- the name of this enumerator.
- Since:
- ASN.1/Java 6.1
-
hashCode
public int hashCode()Returns a hash code for this object- Overrides:
hashCode
in classAbstractData
- Returns:
- a hash code for this object
-
getTypeName
Returns the name of ASN.1 type this java class represents.- Overrides:
getTypeName
in classAbstractData
- Returns:
- the name of the ASN.1 type.
-