KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > snmp > SnmpValue


1 /*
2  * @(#)file SnmpValue.java
3  * @(#)author Sun Microsystems, Inc.
4  * @(#)version 4.9
5  * @(#)date 08/02/09
6  *
7  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
8  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
9  *
10  */

11
12
13 package com.sun.jmx.snmp;
14
15
16
17 import java.io.Serializable JavaDoc;
18
19 /**
20  * Is an abstract representation of an SNMP Value.
21  * All classes provided for dealing with SNMP types should derive from this
22  * class.
23  *
24  * <p><b>This API is a Sun Microsystems internal API and is subject
25  * to change without notice.</b></p>
26  * @version 4.9 12/19/03
27  * @author Sun Microsystems, Inc
28  */

29
30 public abstract class SnmpValue implements Cloneable JavaDoc, Serializable JavaDoc, SnmpDataTypeEnums {
31   
32     /**
33      * Returns a <CODE>String</CODE> form containing ASN.1 tagging information.
34      * @return The <CODE>String</CODE> form.
35      */

36     public String JavaDoc toAsn1String() {
37     return "[" + getTypeName() + "] " + toString();
38     }
39   
40     /**
41      * Returns the value encoded as an OID.
42      * The method is particularly useful when dealing with indexed table made of
43      * several SNMP variables.
44      * @return The value encoded as an OID.
45      */

46     public abstract SnmpOid toOid() ;
47   
48     /**
49      * Returns a textual description of the object.
50      * @return ASN.1 textual description.
51      */

52     public abstract String JavaDoc getTypeName() ;
53   
54     /**
55      * Same as clone, but you cannot perform cloning using this object because
56      * clone is protected. This method should call <CODE>clone()</CODE>.
57      * @return The <CODE>SnmpValue</CODE> clone.
58      */

59     public abstract SnmpValue duplicate() ;
60
61     /**
62      * This method returns <CODE>false</CODE> by default and is redefined
63      * in the {@link com.sun.jmx.snmp.SnmpNull} class.
64      */

65     public boolean isNoSuchObjectValue() {
66         return false;
67     }
68
69     /**
70      * This method returns <CODE>false</CODE> by default and is redefined
71      * in the {@link com.sun.jmx.snmp.SnmpNull} class.
72      */

73     public boolean isNoSuchInstanceValue() {
74         return false;
75     }
76
77     /**
78      * This method returns <CODE>false</CODE> by default and is redefined
79      * in the {@link com.sun.jmx.snmp.SnmpNull} class.
80      */

81     public boolean isEndOfMibViewValue() {
82         return false;
83     }
84 }
85
Popular Tags