public class

SnmpInt

extends SnmpValue
java.lang.Object
   ↳ com.sun.jmx.snmp.SnmpValue
     ↳ com.sun.jmx.snmp.SnmpInt
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Represents an SNMP integer.

This API is a Sun Microsystems internal API and is subject to change without notice.

Summary

[Expand]
Inherited Constants
From interface com.sun.jmx.snmp.SnmpDataTypeEnums
Fields
protected long value This is where the value is stored.
Public Constructors
SnmpInt(int v)
Constructs a new SnmpInt from the specified integer value.
SnmpInt(Integer v)
Constructs a new SnmpInt from the specified Integer value.
SnmpInt(long v)
Constructs a new SnmpInt from the specified long value.
SnmpInt(Long v)
Constructs a new SnmpInt from the specified Long value.
SnmpInt(Enumerated v)
Constructs a new SnmpInt from the specified Enumerated value.
SnmpInt(boolean v)
Constructs a new SnmpInt from the specified boolean value.
Public Methods
static void appendToOid(SnmpOid source, SnmpOid dest)
Appends an SnmpOid representing an SnmpInt to another OID.
synchronized final Object clone()
Clones the SnmpInt object, making a copy of its data.
synchronized final SnmpValue duplicate()
Performs a clone action.
String getTypeName()
Returns a textual description of the type object.
int intValue()
Converts the integer value to its integer form.
long longValue()
Returns the long value of this SnmpInt.
static int nextOid(long[] index, int start)
Scans an index OID, skips the integer value and returns the position of the next value.
Integer toInteger()
Converts the integer value to its Integer form.
Long toLong()
Converts the integer value to its Long form.
SnmpOid toOid()
Converts the integer value to its SnmpOid form.
static SnmpOid toOid(long[] index, int start)
Extracts the integer from an index OID and returns its value converted as an SnmpOid.
String toString()
Converts the integer value to its String form.
[Expand]
Inherited Methods
From class com.sun.jmx.snmp.SnmpValue
From class java.lang.Object

Fields

protected long value

This is where the value is stored. This long is signed.

Public Constructors

public SnmpInt (int v)

Constructs a new SnmpInt from the specified integer value.

Parameters
v The initialization value.
Throws
IllegalArgumentException The specified value is smaller than Integer.MIN_VALUE or larger than Integer.MAX_VALUE.

public SnmpInt (Integer v)

Constructs a new SnmpInt from the specified Integer value.

Parameters
v The initialization value.
Throws
IllegalArgumentException The specified value is smaller than Integer.MIN_VALUE or larger than Integer.MAX_VALUE.

public SnmpInt (long v)

Constructs a new SnmpInt from the specified long value.

Parameters
v The initialization value.
Throws
IllegalArgumentException The specified value is smaller than Integer.MIN_VALUE or larger than Integer.MAX_VALUE.

public SnmpInt (Long v)

Constructs a new SnmpInt from the specified Long value.

Parameters
v The initialization value.
Throws
IllegalArgumentException The specified value is smaller than Integer.MIN_VALUE or larger than Integer.MAX_VALUE.

public SnmpInt (Enumerated v)

Constructs a new SnmpInt from the specified Enumerated value.

Parameters
v The initialization value.
Throws
IllegalArgumentException The specified value is smaller than Integer.MIN_VALUE or larger than Integer.MAX_VALUE.
See Also

public SnmpInt (boolean v)

Constructs a new SnmpInt from the specified boolean value. This constructor applies rfc1903 rule:

 TruthValue ::= TEXTUAL-CONVENTION
     STATUS       current
     DESCRIPTION
             "Represents a boolean value."
     SYNTAX       INTEGER { true(1), false(2) }
 

Parameters
v The initialization value.

Public Methods

public static void appendToOid (SnmpOid source, SnmpOid dest)

Appends an SnmpOid representing an SnmpInt to another OID.

Parameters
source An OID representing an SnmpInt value.
dest Where source should be appended.

public final synchronized Object clone ()

Clones the SnmpInt object, making a copy of its data.

Returns
  • The object clone.

public final synchronized SnmpValue duplicate ()

Performs a clone action. This provides a workaround for the SnmpValue interface.

Returns
  • The SnmpValue clone.

public String getTypeName ()

Returns a textual description of the type object.

Returns
  • ASN.1 textual description.

public int intValue ()

Converts the integer value to its integer form.

Returns
  • The integer representation of the value.

public long longValue ()

Returns the long value of this SnmpInt.

Returns
  • The value.

public static int nextOid (long[] index, int start)

Scans an index OID, skips the integer value and returns the position of the next value.

Parameters
index The index array.
start The position in the index array.
Returns
  • The position of the next value.
Throws
SnmpStatusException There is no integer value available at the start position.

public Integer toInteger ()

Converts the integer value to its Integer form.

Returns
  • The Integer representation of the value.

public Long toLong ()

Converts the integer value to its Long form.

Returns
  • The Long representation of the value.

public SnmpOid toOid ()

Converts the integer value to its SnmpOid form.

Returns
  • The OID representation of the value.

public static SnmpOid toOid (long[] index, int start)

Extracts the integer from an index OID and returns its value converted as an SnmpOid.

Parameters
index The index array.
start The position in the index array.
Returns
  • The OID representing the integer value.
Throws
SnmpStatusException There is no integer value available at the start position.

public String toString ()

Converts the integer value to its String form.

Returns
  • The String representation of the value.