HOME

com.ireasoning.protocol.snmp
Class SnmpGauge32

java.lang.Object
  extended bycom.ireasoning.protocol.snmp.SnmpUInt
      extended bycom.ireasoning.protocol.snmp.SnmpGauge32
All Implemented Interfaces:
Msg, java.io.Serializable, SnmpDataType

public class SnmpGauge32
extends SnmpUInt

This class represents 32-bit Snmp Gauge32 type object. The Gauge32 type represents a non-negative integer, which may increase or decrease, but shall never exceed a maximum value. The maximum value can not be greater than 2^32-1 (4294967295 decimal). The value of a Gauge has its maximum value whenever the information being modeled is greater or equal to that maximum value; if the information being modeled subsequently decreases below the maximum value, the Gauge also decreases.

See Also:
Serialized Form

Field Summary
static SnmpGauge32 MAX_VALUE
          A constant holding the maximum value an SnmpGauge32 can have
 
Fields inherited from interface com.ireasoning.protocol.snmp.SnmpDataType
BITS, BITSTRING, COUNTER32, COUNTER64, END_OF_MIB_VIEW, END_OF_MIB_VIEW_OBJECT, GAUGE32, INTEGER, IPADDRESS, NO_SUCH_INSTANCE, NO_SUCH_INSTANCE_OBJECT, NO_SUCH_OBJECT, NO_SUCH_OBJECT_OBJECT, NULL, OCTETSTRING, OID, OPAQUE, PDU, SEQUENCE, SEQUENCEOF, serialVersionUID, TIMETICKS, UNSIGNED32, VARBIND
 
Fields inherited from interface com.ireasoning.protocol.Msg
ERROR_TYPE
 
Constructor Summary
SnmpGauge32()
          Default constructor
SnmpGauge32(long l)
          Constructs an SnmpGauge32 object with the passed-in l.
SnmpGauge32(SnmpGauge32 gauge32)
          Makes a copy of passed in gauge32 object
SnmpGauge32(SnmpUInt uint)
          Makes a copy of passed in uint32 object
SnmpGauge32(java.lang.String value)
          Constructs an SnmpGauge32 object with the passed-in string value.
 
Method Summary
 SnmpDataType copy()
          Makes a copy of itself
 void dec()
          Decrements gauge value by 1
 void dec(int val)
          Decrements gauge value by passed val
 int encode(com.ireasoning.protocol.snmp.SnmpEncoder encoder)
          For internal use
 int getType()
          Returns SnmpDataType.GAUGE32
 java.lang.String getTypeString()
          Returns "Gauge"
 void inc()
          Increments gauge value by 1, it remains latched at max value.
 void inc(long val)
          Increases gauge value by passed val, it remains latched at max value.
 void setValue(long value)
          Sets a new value
 java.lang.String toString()
           
 
Methods inherited from class com.ireasoning.protocol.snmp.SnmpUInt
equals, getValue, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_VALUE

public static final SnmpGauge32 MAX_VALUE
A constant holding the maximum value an SnmpGauge32 can have

Constructor Detail

SnmpGauge32

public SnmpGauge32()
Default constructor


SnmpGauge32

public SnmpGauge32(java.lang.String value)
Constructs an SnmpGauge32 object with the passed-in string value.


SnmpGauge32

public SnmpGauge32(long l)
Constructs an SnmpGauge32 object with the passed-in l.


SnmpGauge32

public SnmpGauge32(SnmpGauge32 gauge32)
Makes a copy of passed in gauge32 object


SnmpGauge32

public SnmpGauge32(SnmpUInt uint)
Makes a copy of passed in uint32 object

Method Detail

getType

public int getType()
Returns SnmpDataType.GAUGE32

Specified by:
getType in interface SnmpDataType
Overrides:
getType in class SnmpUInt

getTypeString

public java.lang.String getTypeString()
Returns "Gauge"

Specified by:
getTypeString in interface SnmpDataType
Overrides:
getTypeString in class SnmpUInt

inc

public void inc(long val)
Increases gauge value by passed val, it remains latched at max value.

Throws:
java.lang.UnsupportedOperationException - if called for SnmpGauge32.MAX_VALUE

inc

public void inc()
Increments gauge value by 1, it remains latched at max value.

Throws:
java.lang.UnsupportedOperationException - if called for SnmpGauge32.MAX_VALUE

dec

public void dec()
Decrements gauge value by 1

Throws:
java.lang.UnsupportedOperationException - if called for SnmpGauge32.MAX_VALUE

dec

public void dec(int val)
Decrements gauge value by passed val

Throws:
java.lang.UnsupportedOperationException - if called for SnmpGauge32.MAX_VALUE

setValue

public void setValue(long value)
Sets a new value

Overrides:
setValue in class SnmpUInt
Throws:
java.lang.UnsupportedOperationException - if called for SnmpGauge32.MAX_VALUE

toString

public java.lang.String toString()
Overrides:
toString in class SnmpUInt

copy

public SnmpDataType copy()
Description copied from interface: SnmpDataType
Makes a copy of itself

Specified by:
copy in interface SnmpDataType
Overrides:
copy in class SnmpUInt

encode

public int encode(com.ireasoning.protocol.snmp.SnmpEncoder encoder)
           throws SnmpEncodingException
Description copied from interface: SnmpDataType
For internal use

Specified by:
encode in interface SnmpDataType
Overrides:
encode in class SnmpUInt
Throws:
SnmpEncodingException

HOME

Copyright © 2002 iReasoning Inc. All Rights Reserved.