Spec-Zone.ru › OpenJDK 27

Interface PrimitiveValue

All Superinterfaces:
Mirror, Value
All Known Subinterfaces:
BooleanValue, ByteValue, CharValue, DoubleValue, FloatValue, IntegerValue, LongValue, ShortValue
public interface PrimitiveValue extends Value
The value assigned to a field or variable of primitive type in a target VM. Each primitive values is accessed through a subinterface of this interface.
Since:
1.3

Method Summary

Modifier and Type Method Description
boolean booleanValue()
Converts this value to a BooleanValue and returns the result as a boolean.
byte byteValue()
Converts this value to a ByteValue and returns the result as a byte.
char charValue()
Converts this value to a CharValue and returns the result as a char.
double doubleValue()
Converts this value to a DoubleValue and returns the result as a double.
float floatValue()
Converts this value to a FloatValue and returns the result as a float.
int intValue()
Converts this value to an IntegerValue and returns the result as an int.
long longValue()
Converts this value to a LongValue and returns the result as a long.
short shortValue()
Converts this value to a ShortValue and returns the result as a short.

Methods declared in interface Mirror

toString, virtualMachine
Modifier and Type Method Description
String toString()
Returns a String describing this mirror
VirtualMachine virtualMachine()
Gets the VirtualMachine to which this Mirror belongs.

Methods declared in interface Value

type
Modifier and Type Method Description
Type type()
Returns the run-time type of this value.

Method Details

booleanValue

boolean booleanValue()
Converts this value to a BooleanValue and returns the result as a boolean.
Returns:
true if this value is non-zero (or true if already a BooleanValue); false otherwise.

byteValue

byte byteValue()
Converts this value to a ByteValue and returns the result as a byte. The value will be narrowed as necessary, and magnitude or precision information may be lost (as if the primitive had been cast to a byte).
Returns:
the value, converted to byte

charValue

char charValue()
Converts this value to a CharValue and returns the result as a char. The value will be narrowed or widened as necessary, and magnitude or precision information may be lost (as if the primitive had been cast to a char, in the narrowing case).
Returns:
the value, converted to char

shortValue

short shortValue()
Converts this value to a ShortValue and returns the result as a short. The value will be narrowed or widened as necessary, and magnitude or precision information may be lost (as if the primitive had been cast to a short, in the narrowing case).
Returns:
the value, converted to short

intValue

int intValue()
Converts this value to an IntegerValue and returns the result as an int. The value will be narrowed or widened as necessary, and magnitude or precision information may be lost (as if the primitive had been cast to an int, in the narrowing case).
Returns:
the value, converted to int

longValue

long longValue()
Converts this value to a LongValue and returns the result as a long. The value will be narrowed or widened as necessary, and magnitude or precision information may be lost (as if the primitive had been cast to a long, in the narrowing case).
Returns:
the value, converted to long

floatValue

float floatValue()
Converts this value to a FloatValue and returns the result as a float. The value will be narrowed or widened as necessary, and magnitude or precision information may be lost (as if the primitive had been cast to a float, in the narrowing case).
Returns:
the value, converted to float

doubleValue

double doubleValue()
Converts this value to a DoubleValue and returns the result as a double. The value will be widened as necessary, and precision information may be lost.
Returns:
the value, converted to double

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2026, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API