001: /*
002: * Copyright 1998-2000 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: package com.sun.jdi;
027:
028: /**
029: * The value assigned to a field or variable of primitive type in a
030: * target VM. Each primitive values is accessed through a subinterface
031: * of this interface.
032: *
033: * @author Robert Field
034: * @author Gordon Hirsch
035: * @author James McIlree
036: * @since 1.3
037: */
038: public interface PrimitiveValue extends Value {
039: /**
040: * Converts this value to a BooleanValue and returns the result
041: * as a boolean.
042: *
043: * @return <code>true</code> if this value is non-zero (or
044: * <code>true</code> if already a BooleanValue); false otherwise.
045: */
046: boolean booleanValue();
047:
048: /**
049: * Converts this value to a ByteValue and returns the result
050: * as a byte. The value will be narrowed as
051: * necessary, and magnitude or precision information
052: * may be lost (as if the primitive had been cast to a byte).
053: *
054: * @return the value, converted to byte
055: */
056: byte byteValue();
057:
058: /**
059: * Converts this value to a CharValue and returns the result
060: * as a char. The value will be narrowed or widened as
061: * necessary, and magnitude or precision information
062: * may be lost (as if the primitive had been cast to a char,
063: * in the narrowing case).
064: *
065: * @return the value, converted to char
066: */
067: char charValue();
068:
069: /**
070: * Converts this value to a ShortValue and returns the result
071: * as a short. The value will be narrowed or widened as
072: * necessary, and magnitude or precision information
073: * may be lost (as if the primitive had been cast to a short,
074: * in the narrowing case).
075: *
076: * @return the value, converted to short
077: */
078: short shortValue();
079:
080: /**
081: * Converts this value to an IntegerValue and returns the result
082: * as an int. The value will be narrowed or widened as
083: * necessary, and magnitude or precision information
084: * may be lost (as if the primitive had been cast to an int,
085: * in the narrowing case).
086: *
087: * @return the value, converted to int
088: */
089: int intValue();
090:
091: /**
092: * Converts this value to a LongValue and returns the result
093: * as a long. The value will be narrowed or widened as
094: * necessary, and magnitude or precision information
095: * may be lost (as if the primitive had been cast to a long,
096: * in the narrowing case).
097: *
098: * @return the value, converted to long
099: */
100: long longValue();
101:
102: /**
103: * Converts this value to a FloatValue and returns the result
104: * as a float. The value will be narrowed or widened as
105: * necessary, and magnitude or precision information
106: * may be lost (as if the primitive had been cast to a float,
107: * in the narrowing case).
108: *
109: * @return the value, converted to float
110: */
111: float floatValue();
112:
113: /**
114: * Converts this value to a DoubleValue and returns the result
115: * as a double. The value will be widened as
116: * necessary, and precision information
117: * may be lost.
118: *
119: * @return the value, converted to double
120: */
121: double doubleValue();
122: }
|