Constructors Summary |
---|
public SnmpInt(int v)Constructs a new SnmpInt from the specified integer value.
if ( isInitValueValid(v) == false ) {
throw new IllegalArgumentException() ;
}
value = (long)v ;
|
public SnmpInt(Integer v)Constructs a new SnmpInt from the specified Integer value.
this(v.intValue()) ;
|
public SnmpInt(long v)Constructs a new SnmpInt from the specified long value.
if ( isInitValueValid(v) == false ) {
throw new IllegalArgumentException() ;
}
value = v ;
|
public SnmpInt(Long v)Constructs a new SnmpInt from the specified Long value.
this(v.longValue()) ;
|
public SnmpInt(com.sun.jmx.snmp.Enumerated v)Constructs a new SnmpInt from the specified Enumerated value.
this(v.intValue()) ;
|
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) }
value = v ? 1 : 2 ;
|
Methods Summary |
---|
public static void | appendToOid(SnmpOid source, SnmpOid dest)Appends an SnmpOid representing an SnmpInt to another OID.
if (source.getLength() != 1) {
throw new IllegalArgumentException() ;
}
dest.append(source) ;
|
public final synchronized java.lang.Object | clone()Clones the SnmpInt object, making a copy of its data.
SnmpInt newclone = null ;
try {
newclone = (SnmpInt) super.clone() ;
newclone.value = value ;
} catch (CloneNotSupportedException e) {
throw new InternalError() ; // vm bug.
}
return newclone ;
|
public final synchronized SnmpValue | duplicate()Performs a clone action. This provides a workaround for the
SnmpValue interface.
return (SnmpValue) clone() ;
|
public java.lang.String | getTypeName()Returns a textual description of the type object.
return name ;
|
public int | intValue()Converts the integer value to its integer form.
return (int) value ;
|
boolean | isInitValueValid(int v)This method has been defined to allow the sub-classes
of SnmpInt to perform their own control at intialization time.
if ((v < Integer.MIN_VALUE) || (v > Integer.MAX_VALUE)) {
return false;
}
return true;
|
boolean | isInitValueValid(long v)This method has been defined to allow the sub-classes
of SnmpInt to perform their own control at intialization time.
if ((v < Integer.MIN_VALUE) || (v > Integer.MAX_VALUE)) {
return false;
}
return true;
|
public long | longValue()Returns the long value of this SnmpInt .
return 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.
if (start >= index.length) {
throw new SnmpStatusException(SnmpStatusException.noSuchName) ;
}
else {
return start + 1 ;
}
|
public java.lang.Integer | toInteger()Converts the integer value to its Integer form.
return new Integer((int)value) ;
|
public java.lang.Long | toLong()Converts the integer value to its Long form.
return new Long(value) ;
|
public SnmpOid | toOid()Converts the integer value to its SnmpOid form.
return new SnmpOid(value) ;
|
public static SnmpOid | toOid(long[] index, int start)Extracts the integer from an index OID and returns its
value converted as an SnmpOid .
try {
return new SnmpOid(index[start]) ;
}
catch(IndexOutOfBoundsException e) {
throw new SnmpStatusException(SnmpStatusException.noSuchName) ;
}
|
public java.lang.String | toString()Converts the integer value to its String form.
return String.valueOf(value) ;
|