1 11 12 13 package com.sun.jmx.snmp; 14 15 16 17 22 23 public class SnmpNull extends SnmpValue { 24 25 30 public SnmpNull() { 31 tag = NullTag ; 32 } 33 34 38 public SnmpNull(String dummy) { 39 this(); 40 } 41 42 46 public SnmpNull(int t) { 47 tag = t ; 48 } 49 50 56 public int getTag() { 57 return tag ; 58 } 59 60 66 public String toString() { 67 String result = "" ; 68 if (tag != 5) { 69 result += "[" + tag + "] " ; 70 } 71 result += "NULL" ; 72 switch(tag) { 73 case errNoSuchObjectTag : 74 result += " (noSuchObject)" ; 75 break ; 76 77 case errNoSuchInstanceTag : 78 result += " (noSuchInstance)" ; 79 break ; 80 81 case errEndOfMibViewTag : 82 result += " (endOfMibView)" ; 83 break ; 84 } 85 return result ; 86 } 87 88 94 public SnmpOid toOid() { 95 throw new IllegalArgumentException () ; 96 } 97 98 103 final synchronized public SnmpValue duplicate() { 104 return (SnmpValue) clone() ; 105 } 106 107 111 final synchronized public Object clone() { 112 SnmpNull newclone = null ; 113 try { 114 newclone = (SnmpNull) super.clone() ; 115 newclone.tag = tag ; 116 } catch (CloneNotSupportedException e) { 117 throw new InternalError () ; } 119 return newclone ; 120 } 121 122 126 final public String getTypeName() { 127 return name ; 128 } 129 130 135 public boolean isNoSuchObjectValue() { 136 return (tag == SnmpDataTypeEnums.errNoSuchObjectTag); 137 } 138 139 144 public boolean isNoSuchInstanceValue() { 145 return (tag == SnmpDataTypeEnums.errNoSuchInstanceTag); 146 } 147 148 153 public boolean isEndOfMibViewValue() { 154 return (tag == SnmpDataTypeEnums.errEndOfMibViewTag); 155 } 156 157 162 final static String name = "Null" ; 163 164 167 private int tag = 5 ; 168 } 169 | Popular Tags |