SourceForge.net Logo

org.netsnmp.ASN
Class ASNValue

java.lang.Object
  |
  +--org.netsnmp.ASN.ASNValue
All Implemented Interfaces:
Comparable, Serializable
Direct Known Subclasses:
COUNTER, INTEGER, NO_SUCH_INSTANCE, NO_SUCH_OBJECT, NULL, OBJECTID, OCTET_STR

public abstract class ASNValue
extends Object
implements Comparable, Serializable

Base class for value types used for getting/setting data from remote Agents

Author:
Andrew E. Page aepage@users.sourceforge.net
See Also:
Serialized Form

Constructor Summary
ASNValue()
           
 
Method Summary
abstract  int asn_type()
           
 int compareTo(Object o)
           
 boolean toBoolean()
          Converts the value to a boolean.
 int toInt()
          Converts the value to a java int.
 long toInt64()
          Converts the value to java long.
abstract  Object toJavaObject()
          Converts the value to a Java Object
 int[] toOBJECTID()
          Converts the value to an OBJECTOID
 byte[] toOctetString()
          Converts the value to an integer.
abstract  ASN_TYPE type()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASNValue

public ASNValue()
Method Detail

toBoolean

public boolean toBoolean()
                  throws NetSNMPBadValue
Converts the value to a boolean.

Throws:
NetSNMPBadValue - if this value is not a BOOLEAN

toInt

public int toInt()
          throws NetSNMPBadValue
Converts the value to a java int.

Throws:
NetSNMPBadValue - if this value is not some integer type

toInt64

public long toInt64()
             throws NetSNMPBadValue
Converts the value to java long.

Throws:
NetSNMPBadValue - if this value is not some long type

toOctetString

public byte[] toOctetString()
                     throws NetSNMPBadValue
Converts the value to an integer.

Throws:
NetSNMPBadValue - if this value is not an OCTECT_STR

toOBJECTID

public int[] toOBJECTID()
                 throws NetSNMPBadValue
Converts the value to an OBJECTOID

Throws:
NetSNMPBadValue - if this value cannot be converted to an OBJECTID

toJavaObject

public abstract Object toJavaObject()
Converts the value to a Java Object


type

public abstract ASN_TYPE type()

asn_type

public abstract int asn_type()

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

SourceForge.net Logo