MySnmpCrawler API

snmp.message.datatype
Class MySnmpCrawlerCounter32

java.lang.Object
  |
  +--org.opennms.protocols.snmp.SnmpUInt32
        |
        +--org.opennms.protocols.snmp.SnmpCounter32
              |
              +--snmp.message.datatype.MySnmpCrawlerCounter32
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, SnmpDatatype, org.opennms.protocols.snmp.SnmpSyntax

public class MySnmpCrawlerCounter32
extends org.opennms.protocols.snmp.SnmpCounter32
implements SnmpDatatype

Represents Counter (Counter32).

Version:
$Revision: 0.1 $ $Date: 2004/03/09 06:03:50 $
Author:
Scott Cheng
See Also:
Serialized Form

Field Summary
static java.lang.Class expectType
           
static java.lang.String javaDataType
           
 
Fields inherited from class org.opennms.protocols.snmp.SnmpCounter32
ASNTYPE
 
Fields inherited from class org.opennms.protocols.snmp.SnmpUInt32
 
Constructor Summary
MySnmpCrawlerCounter32()
          The default Constructor.
MySnmpCrawlerCounter32(java.lang.Long value)
          Constructs the MySnmpCrawlerCounter32 object with the Long object.
MySnmpCrawlerCounter32(MySnmpCrawlerCounter32 second)
          The copy Constructor constructs the MySnmpCrawlerCounter32 object that is identical to the passed object.
MySnmpCrawlerCounter32(org.opennms.protocols.snmp.SnmpUInt32 uint32)
          Constructs the MySnmpCrawlerCounter32 object with the SnmpUInt32 object.
 
Method Summary
 java.lang.Object clone()
          Creates a new object that is a duplicate of the current object.
 org.opennms.protocols.snmp.SnmpSyntax duplicate()
          Creates a new object that is a duplicate of the current object.
 java.lang.String getJavaDataType()
          Gets the string description of the expected java datatype.
 java.lang.Object getJavaDataValue()
          Gets the Java object value corresponding to the the SnmpSyntax object.
 boolean isValidJavaDatatype(java.lang.Class c)
          Checks to see if the exptected Class type equals to the passed Class object.
 boolean isValidJavaDatatype(java.lang.Object o)
          Checks if the expected datatype of the Java object value matches to the passed Java object value.
 void setSnmpDataValue(java.lang.Object o)
          Sets the Java object value into the SnmpSyntax object.
static boolean validateJavaDatatype(java.lang.Object o)
          Validates the Java object value with the expected datatype.
 
Methods inherited from class org.opennms.protocols.snmp.SnmpCounter32
toString, typeId
 
Methods inherited from class org.opennms.protocols.snmp.SnmpUInt32
decodeASN, encodeASN, getValue, setValue, setValue
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opennms.protocols.snmp.SnmpSyntax
decodeASN, encodeASN, typeId
 

Field Detail

javaDataType

public static final java.lang.String javaDataType
See Also:
Constant Field Values

expectType

public static java.lang.Class expectType
Constructor Detail

MySnmpCrawlerCounter32

public MySnmpCrawlerCounter32()
The default Constructor.


MySnmpCrawlerCounter32

public MySnmpCrawlerCounter32(java.lang.Long value)
Constructs the MySnmpCrawlerCounter32 object with the Long object.

Parameters:
value - The Long object.

MySnmpCrawlerCounter32

public MySnmpCrawlerCounter32(MySnmpCrawlerCounter32 second)
The copy Constructor constructs the MySnmpCrawlerCounter32 object that is identical to the passed object.

Parameters:
second - The object to be copied from.

MySnmpCrawlerCounter32

public MySnmpCrawlerCounter32(org.opennms.protocols.snmp.SnmpUInt32 uint32)
Constructs the MySnmpCrawlerCounter32 object with the SnmpUInt32 object.

Method Detail

setSnmpDataValue

public void setSnmpDataValue(java.lang.Object o)
                      throws SnmpException
Sets the Java object value into the SnmpSyntax object.

Specified by:
setSnmpDataValue in interface SnmpDatatype
Parameters:
o - The Java object value.
Throws:
SnmpException - Thrown when the Java object value does not match to the expected datatype in the SnmpSyntax object.

getJavaDataValue

public java.lang.Object getJavaDataValue()
                                  throws SnmpException
Gets the Java object value corresponding to the the SnmpSyntax object.

Specified by:
getJavaDataValue in interface SnmpDatatype
Returns:
The Java object value corresponding to the the SnmpSyntax object.
Throws:
SnmpException - Thrown when any error occurs during converting the SnmpSyntax value to the Java object.

clone

public java.lang.Object clone()
Creates a new object that is a duplicate of the current object.

Overrides:
clone in class org.opennms.protocols.snmp.SnmpCounter32
Returns:
The newly created duplicate object.

duplicate

public org.opennms.protocols.snmp.SnmpSyntax duplicate()
Creates a new object that is a duplicate of the current object.

Specified by:
duplicate in interface org.opennms.protocols.snmp.SnmpSyntax
Overrides:
duplicate in class org.opennms.protocols.snmp.SnmpCounter32
Returns:
The newly created duplicate object.

isValidJavaDatatype

public boolean isValidJavaDatatype(java.lang.Object o)
Checks if the expected datatype of the Java object value matches to the passed Java object value.

Specified by:
isValidJavaDatatype in interface SnmpDatatype
Parameters:
o - The Java object value.
Returns:
True if matched to the expected type, otherwise false.

isValidJavaDatatype

public boolean isValidJavaDatatype(java.lang.Class c)
Checks to see if the exptected Class type equals to the passed Class object.

Specified by:
isValidJavaDatatype in interface SnmpDatatype
Parameters:
c - The Class object to be checked.
Returns:
True if matched to the expected type, otherwise false.

getJavaDataType

public java.lang.String getJavaDataType()
Gets the string description of the expected java datatype.

Specified by:
getJavaDataType in interface SnmpDatatype
Returns:
The string description of the expected java datatype.

validateJavaDatatype

public static boolean validateJavaDatatype(java.lang.Object o)
Validates the Java object value with the expected datatype.

Returns:
True if matched to the expected type, otherwise false.

MySnmpCrawler API