Path: blob/master/src/jdk.jdi/share/classes/com/sun/jdi/PrimitiveValue.java
41159 views
/*1* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package com.sun.jdi;2627/**28* The value assigned to a field or variable of primitive type in a29* target VM. Each primitive values is accessed through a subinterface30* of this interface.31*32* @author Robert Field33* @author Gordon Hirsch34* @author James McIlree35* @since 1.336*/37public interface PrimitiveValue extends Value {3839/**40* Converts this value to a BooleanValue and returns the result41* as a boolean.42*43* @return <code>true</code> if this value is non-zero (or44* <code>true</code> if already a BooleanValue); false otherwise.45*/46boolean booleanValue();4748/**49* Converts this value to a ByteValue and returns the result50* as a byte. The value will be narrowed as51* necessary, and magnitude or precision information52* may be lost (as if the primitive had been cast to a byte).53*54* @return the value, converted to byte55*/56byte byteValue();5758/**59* Converts this value to a CharValue and returns the result60* as a char. The value will be narrowed or widened as61* necessary, and magnitude or precision information62* may be lost (as if the primitive had been cast to a char,63* in the narrowing case).64*65* @return the value, converted to char66*/67char charValue();6869/**70* Converts this value to a ShortValue and returns the result71* as a short. The value will be narrowed or widened as72* necessary, and magnitude or precision information73* may be lost (as if the primitive had been cast to a short,74* in the narrowing case).75*76* @return the value, converted to short77*/78short shortValue();7980/**81* Converts this value to an IntegerValue and returns the result82* as an int. The value will be narrowed or widened as83* necessary, and magnitude or precision information84* may be lost (as if the primitive had been cast to an int,85* in the narrowing case).86*87* @return the value, converted to int88*/89int intValue();9091/**92* Converts this value to a LongValue and returns the result93* as a long. The value will be narrowed or widened as94* necessary, and magnitude or precision information95* may be lost (as if the primitive had been cast to a long,96* in the narrowing case).97*98* @return the value, converted to long99*/100long longValue();101102/**103* Converts this value to a FloatValue and returns the result104* as a float. The value will be narrowed or widened as105* necessary, and magnitude or precision information106* 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 float110*/111float floatValue();112113/**114* Converts this value to a DoubleValue and returns the result115* as a double. The value will be widened as116* necessary, and precision information117* may be lost.118*119* @return the value, converted to double120*/121double doubleValue();122}123124125