KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdi > internal > VoidValueImpl


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdi.internal;
12
13
14 import java.io.DataOutputStream JavaDoc;
15
16 import org.eclipse.jdi.internal.jdwp.JdwpID;
17
18 import com.sun.jdi.Type;
19 import com.sun.jdi.VoidValue;
20
21 /**
22  * this class implements the corresponding interfaces
23  * declared by the JDI specification. See the com.sun.jdi package
24  * for more information.
25  *
26  */

27 public class VoidValueImpl extends ValueImpl implements VoidValue {
28     /** JDWP Tag. */
29     public static final byte tag = JdwpID.VOID_TAG;
30
31     /**
32      * Creates new instance.
33      */

34     public VoidValueImpl(VirtualMachineImpl vmImpl) {
35         super("VoidValue", vmImpl); //$NON-NLS-1$
36
}
37     
38     /**
39      * @returns tag.
40      */

41     public byte getTag() {
42         return tag;
43     }
44     
45     /**
46      * @returns type of value.
47      */

48     public Type type() {
49         return new VoidTypeImpl(virtualMachineImpl());
50     }
51
52     /**
53      * @return Returns true if two values are equal.
54      * @see java.lang.Object#equals(Object)
55      */

56     public boolean equals(Object JavaDoc object) {
57         return object != null && object.getClass().equals(this.getClass());
58     }
59     
60     /**
61      * @return Returns a has code for this object.
62      * @see java.lang.Object#hashCode
63      */

64     public int hashCode() {
65         return 0;
66     }
67     
68     /**
69      * Writes value without value tag.
70      */

71     public void write(MirrorImpl target, DataOutputStream JavaDoc out) {
72         // Nothing to write.
73
}
74
75     /**
76      * @return Returns description of Mirror object.
77      */

78     public String JavaDoc toString() {
79         return "(void)"; //$NON-NLS-1$
80
}
81 }
82
Popular Tags