FileDocCategorySizeDatePackage
SnmpNull.javaAPI DocJava SE 5 API4636Fri Aug 26 14:55:02 BST 2005com.sun.jmx.snmp

SnmpNull

public class SnmpNull extends SnmpValue
Represents an SNMP null value.

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

Fields Summary
static final String
name
Name of the type.
private int
tag
This is the tag of the NULL value. By default, it is the universal tag value.
Constructors Summary
public SnmpNull()
Constructs a new SnmpNull.

        tag = NullTag ;
    
public SnmpNull(String dummy)
Constructs a new SnmpNull.
For mibgen private use only.

        this();
    
public SnmpNull(int t)
Constructs a new SnmpNull from the specified tag value.

param
t The initialization value.

        tag = t ;
    
Methods Summary
public final synchronized java.lang.Objectclone()
Clones the SnmpNull object, making a copy of its data.

return
The object clone.

        SnmpNull  newclone = null ;
        try {
            newclone = (SnmpNull) super.clone() ;
            newclone.tag = tag ;
        } catch (CloneNotSupportedException e) {
            throw new InternalError() ; // vm bug.
        }
        return newclone ;
    
public final synchronized SnmpValueduplicate()
Performs a clone action. This provides a workaround for the SnmpValue interface.

return
The SnmpValue clone.

        return (SnmpValue) clone() ;
    
public intgetTag()
Returns the tag value of this SnmpNull.

return
The value.

        return tag ;
    
public final java.lang.StringgetTypeName()
Returns a textual description of the type object.

return
ASN.1 textual description.

        return name ;
    
public booleanisEndOfMibViewValue()
Checks if this SnmpNull object corresponds to an endOfMibView value.

return
true if the tag equals {@link com.sun.jmx.snmp.SnmpDataTypeEnums#errEndOfMibViewTag}, false otherwise.

        return (tag == SnmpDataTypeEnums.errEndOfMibViewTag);
    
public booleanisNoSuchInstanceValue()
Checks if this SnmpNull object corresponds to a noSuchInstance value.

return
true if the tag equals {@link com.sun.jmx.snmp.SnmpDataTypeEnums#errNoSuchInstanceTag}, false otherwise.

        return (tag == SnmpDataTypeEnums.errNoSuchInstanceTag);
    
public booleanisNoSuchObjectValue()
Checks if this SnmpNull object corresponds to a noSuchObject value.

return
true if the tag equals {@link com.sun.jmx.snmp.SnmpDataTypeEnums#errNoSuchObjectTag}, false otherwise.

        return (tag == SnmpDataTypeEnums.errNoSuchObjectTag);
    
public SnmpOidtoOid()
Converts the NULL value to its SnmpOid form. Normally, a NULL value cannot be used as an index value, this method triggers an exception.

return
The OID representation of the value.

        throw new IllegalArgumentException() ;
    
public java.lang.StringtoString()
Converts the NULL value to its ASN.1 String form. When the tag is not the universal one, it is preprended to the String form.

return
The String representation of the value.

        String result = "" ;
        if (tag != 5) {
            result += "[" + tag + "] " ;
        }
        result += "NULL" ;
        switch(tag) {
    	case errNoSuchObjectTag :
            result += " (noSuchObject)" ;
            break ;
        
    	case errNoSuchInstanceTag :
            result += " (noSuchInstance)" ;
            break ;
        
    	case errEndOfMibViewTag :
            result += " (endOfMibView)" ;
            break ;
        }
        return result ;