Top Description Inners Fields Constructors Methods
com.jogamp.common.os

public Class Platform

extends PlatformPropsImpl
Class Inheritance
Imports
java.security.AccessController, .PrivilegedAction, java.util.concurrent.TimeUnit, com.jogamp.common.jvm.JNILibLoaderBase, com.jogamp.common.net.Uri, com.jogamp.common.util.JarUtil, .PropertyAccess, .ReflectionUtil, .VersionNumber, com.jogamp.common.util.cache.TempJarCache, jogamp.common.jvm.JVMUtil, jogamp.common.os.MachineDataInfoRuntime, .PlatformPropsImpl

Utility class for querying platform specific properties.

Some field declarations and it's static initialization has been delegated to it's super class PlatformPropsImpl to solve static initialization interdependencies w/ the GlueGen native library loading and it's derived information getMachineDataInfo(), is32Bit(), ..
This mechanism is preferred in this case to avoid synchronization and locking and allow better performance accessing the mentioned fields/methods.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
public static enum
public static enum
public static enum

Field Summary

Modifier and TypeField and Description
public static final boolean
AWT_AVAILABLE

true if AWT is available and not in headless mode, otherwise false.

private static final boolean
private static final String
libBaseName

fixed basename of JAR file and native library

private static final MachineDataInfo
public static final boolean
USE_TEMP_JAR_CACHE

System property: 'jogamp.gluegen.UseTempJarCache', defaults to true if OS_TYPE is not OSType#ANDROID.

private static final String
Inherited from jogamp.common.os.PlatformPropsImpl:
ABI_TYPEARCHARCH_lowerCPU_ARCHJAVA_6JAVA_RUNTIME_NAMEJAVA_SEJAVA_VENDORJAVA_VENDOR_URLJAVA_VERSIONJAVA_VERSION_NUMBERJAVA_VERSION_UPDATEJAVA_VM_NAMELITTLE_ENDIANNEWLINEOSos_and_archOS_lowerOS_TYPEOS_VERSIONOS_VERSION_NUMBERVersion16Version17Version18Version19

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static native long
currentTimeMicros()

Returns the unix based current time in microseconds, based on gettimeofday(..).

public static native long
currentTimeMillis()

Returns the unix based current time in milliseconds, based on gettimeofday(..).

public static Platform.ABIType
getABIType()

Returns the ABI type.

public static String
getArchName()

Returns the CPU architecture String.

public static Platform.CPUFamily
getCPUFamily()

Returns the CPU family.

public static Platform.CPUType
getCPUType()

Returns the CPU architecture type.

public static synchronized long
getCurrentSleepJitter()

Returns the estimated sleep jitter value in nanoseconds.

private static long
getCurrentSleepJitterImpl(final long nsDuration, final int splitInLoops)

public static String
getJavaRuntimeName()

Returns the JAVA runtime name.

public static String
getJavaVendor()

Returns the JAVA vendor.

public static String
getJavaVendorURL()

Returns the JAVA vendor url.

public static String
getJavaVersion()

Returns the JAVA version.

public static VersionNumber
getJavaVersionNumber()

Returns the JAVA version number.

public static String
getJavaVMName()

Returns the JAVA VM name.

public static MachineDataInfo
getMachineDataInfo()

Returns the MachineDataInfo of the running machine.

public static String
getNewline()

Returns the platform's line separator.

public static String
getOSAndArch()

Returns the GlueGen common name for the currently running OSType and CPUType as implemented in the build system in 'gluegen-cpptasks-base.xml'.

public static String
getOSName()

Returns the OS name.

public static Platform.OSType
getOSType()

Returns the OS type.

public static String
getOSVersion()

Returns the OS version.

public static VersionNumber
getOSVersionNumber()

Returns the OS version number.

public static void
initSingleton()

Hides jogamp.common.os.PlatformPropsImpl.initSingleton.

kick off static initialization of platform property information and native gluegen-rt lib loading
public static boolean
is32Bit()

Returns true if this JVM/ARCH is 32bit.

public static boolean
is64Bit()

Returns true if this JVM/ARCH is 64bit.

public static boolean
isAWTAvailable()

Returns true if AWT is available and not in headless mode, otherwise false.

public static boolean
isLittleEndian()

Returns true if this machine is little endian, otherwise false.

public static final boolean

Returns:

true if we're running from a Jar URL, otherwise false
isRunningFromJarURL
()

Inherited from jogamp.common.os.PlatformPropsImpl:
getOSAndArchisCompatible

Field Detail

AWT_AVAILABLEback to summary
public static final boolean AWT_AVAILABLE

true if AWT is available and not in headless mode, otherwise false.

isRunningFromJarURLback to summary
private static final boolean isRunningFromJarURL
libBaseNameback to summary
private static final String libBaseName

fixed basename of JAR file and native library

machineDescriptionback to summary
private static final MachineDataInfo machineDescription
USE_TEMP_JAR_CACHEback to summary
public static final boolean USE_TEMP_JAR_CACHE

System property: 'jogamp.gluegen.UseTempJarCache', defaults to true if OS_TYPE is not OSType#ANDROID.

useTempJarCachePropNameback to summary
private static final String useTempJarCachePropName

Constructor Detail

Platformback to summary
private Platform()

Method Detail

currentTimeMicrosback to summary
public static native long currentTimeMicros()

Returns the unix based current time in microseconds, based on gettimeofday(..).

This is an alternative to System#currentTimeMillis() and System#nanoTime(). While the named System methods do provide the required precision, gettimeofday() also guarantees time accuracy, i.e. update interval.

See Also
currentTimeMillis()
currentTimeMillisback to summary
public static native long currentTimeMillis()

Returns the unix based current time in milliseconds, based on gettimeofday(..).

This is an alternative to System#currentTimeMillis() and System#nanoTime(). While the named System methods do provide the required precision, gettimeofday() also guarantees time accuracy, i.e. update interval.

See Also
currentTimeMicros()
getABITypeback to summary
public static Platform.ABIType getABIType()

Returns the ABI type.

In case of CPUFamily#ARM, the value is determined by parsing the Elf Headers of the running VM.

Otherwise the value is ABIType#GENERIC_ABI.

getArchNameback to summary
public static String getArchName()

Returns the CPU architecture String.

getCPUFamilyback to summary
public static Platform.CPUFamily getCPUFamily()

Returns the CPU family.

getCPUTypeback to summary
public static Platform.CPUType getCPUType()

Returns the CPU architecture type.

getCurrentSleepJitterback to summary
public static synchronized long getCurrentSleepJitter()

Returns the estimated sleep jitter value in nanoseconds.

Includes a warm-up path, allowing hotspot to optimize the code.

getCurrentSleepJitterImplback to summary
private static long getCurrentSleepJitterImpl(final long nsDuration, final int splitInLoops)
getJavaRuntimeNameback to summary
public static String getJavaRuntimeName()

Returns the JAVA runtime name.

getJavaVendorback to summary
public static String getJavaVendor()

Returns the JAVA vendor.

getJavaVendorURLback to summary
public static String getJavaVendorURL()

Returns the JAVA vendor url.

getJavaVersionback to summary
public static String getJavaVersion()

Returns the JAVA version.

getJavaVersionNumberback to summary
public static VersionNumber getJavaVersionNumber()

Returns the JAVA version number.

getJavaVMNameback to summary
public static String getJavaVMName()

Returns the JAVA VM name.

getMachineDataInfoback to summary
public static MachineDataInfo getMachineDataInfo()

Returns the MachineDataInfo of the running machine.

getNewlineback to summary
public static String getNewline()

Returns the platform's line separator.

getOSAndArchback to summary
public static String getOSAndArch()

Returns the GlueGen common name for the currently running OSType and CPUType as implemented in the build system in 'gluegen-cpptasks-base.xml'.

See Also
getOSAndArch(OSType, CPUType)
getOSNameback to summary
public static String getOSName()

Returns the OS name.

In case of OSType#ANDROID, see getOSType(), the OS name is Linux

getOSTypeback to summary
public static Platform.OSType getOSType()

Returns the OS type.

In case of OSType#ANDROID the OS name, is Linux

getOSVersionback to summary
public static String getOSVersion()

Returns the OS version.

getOSVersionNumberback to summary
public static VersionNumber getOSVersionNumber()

Returns the OS version number.

initSingletonback to summary
public static void initSingleton()

Hides jogamp.common.os.PlatformPropsImpl.initSingleton.

kick off static initialization of platform property information and native gluegen-rt lib loading

is32Bitback to summary
public static boolean is32Bit()

Returns true if this JVM/ARCH is 32bit.

Shortcut to getCPUType().is32Bit

is64Bitback to summary
public static boolean is64Bit()

Returns true if this JVM/ARCH is 64bit.

Shortcut to !getCPUType().is32Bit

isAWTAvailableback to summary
public static boolean isAWTAvailable()

Returns true if AWT is available and not in headless mode, otherwise false.

isLittleEndianback to summary
public static boolean isLittleEndian()

Returns true if this machine is little endian, otherwise false.

isRunningFromJarURLback to summary
public static final boolean isRunningFromJarURL()
Returns:boolean

true if we're running from a Jar URL, otherwise false

com.jogamp.common.os back to summary

public final Enum Platform.ABIType

extends Enum<Platform.ABIType>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final Platform.ABIType
EABI_AARCH64

ARM EABI AARCH64 (64bit)

public static final Platform.ABIType
EABI_GNU_ARMEL

ARM GNU-EABI ARMEL -mfloat-abi=softfp

public static final Platform.ABIType
EABI_GNU_ARMHF

ARM GNU-EABI ARMHF -mfloat-abi=hard

public static final Platform.ABIType
public final int

Constructor Summary

AccessConstructor and Description
private
ABIType(final int id)

Method Summary

Modifier and TypeMethod and Description
public final boolean
isCompatible(final Platform.ABIType other)

Returns true if the given ABIType is compatible w/ this one, i.e. they are equal.

public static final Platform.ABIType
query(final Platform.CPUType cpuType, final String cpuABILower)

public static Platform.ABIType
public static Platform.ABIType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

EABI_AARCH64back to summary
public static final Platform.ABIType EABI_AARCH64

ARM EABI AARCH64 (64bit)

EABI_GNU_ARMELback to summary
public static final Platform.ABIType EABI_GNU_ARMEL

ARM GNU-EABI ARMEL -mfloat-abi=softfp

EABI_GNU_ARMHFback to summary
public static final Platform.ABIType EABI_GNU_ARMHF

ARM GNU-EABI ARMHF -mfloat-abi=hard

GENERIC_ABIback to summary
public static final Platform.ABIType GENERIC_ABI
idback to summary
public final int id

Constructor Detail

ABITypeback to summary
private ABIType(final int id)

Method Detail

isCompatibleback to summary
public final boolean isCompatible(final Platform.ABIType other)

Returns true if the given ABIType is compatible w/ this one, i.e. they are equal.

queryback to summary
public static final Platform.ABIType query(final Platform.CPUType cpuType, final String cpuABILower)
valueOfback to summary
public static Platform.ABIType valueOf(String name)
valuesback to summary
public static Platform.ABIType[] values()
com.jogamp.common.os back to summary

public final Enum Platform.CPUFamily

extends Enum<Platform.CPUFamily>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final Platform.CPUFamily
ARM

ARM

public static final Platform.CPUFamily
IA64

Itanium

public static final Platform.CPUFamily
MIPS

Mips

public static final Platform.CPUFamily
PA_RISC

PA RISC

public static final Platform.CPUFamily
PPC

Power PC

public static final Platform.CPUFamily
SPARC

SPARC

public static final Platform.CPUFamily
SuperH

Hitachi SuperH

public static final Platform.CPUFamily
X86

AMD/Intel

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Platform.CPUFamily
public static Platform.CPUFamily[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ARMback to summary
public static final Platform.CPUFamily ARM

ARM

IA64back to summary
public static final Platform.CPUFamily IA64

Itanium

MIPSback to summary
public static final Platform.CPUFamily MIPS

Mips

PA_RISCback to summary
public static final Platform.CPUFamily PA_RISC

PA RISC

PPCback to summary
public static final Platform.CPUFamily PPC

Power PC

SPARCback to summary
public static final Platform.CPUFamily SPARC

SPARC

SuperHback to summary
public static final Platform.CPUFamily SuperH

Hitachi SuperH

X86back to summary
public static final Platform.CPUFamily X86

AMD/Intel

Constructor Detail

CPUFamilyback to summary
private CPUFamily()

Method Detail

valueOfback to summary
public static Platform.CPUFamily valueOf(String name)
valuesback to summary
public static Platform.CPUFamily[] values()
com.jogamp.common.os back to summary

public final Enum Platform.CPUType

extends Enum<Platform.CPUType>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final Platform.CPUType
ARM

ARM 32bit default, usually little endian

public static final Platform.CPUType
ARM64

ARM64 default (64bit), usually little endian

public static final Platform.CPUType
ARMv5

ARM7EJ, ARM9E, ARM10E, XScale, usually little endian

public static final Platform.CPUType
ARMv6

ARM11, usually little endian

public static final Platform.CPUType
ARMv7

ARM Cortex, usually little endian

public static final Platform.CPUType
ARMv8_A

ARM AArch64 (64bit), usually little endian

public final Platform.CPUFamily
public static final Platform.CPUType
IA64

Itanium 64bit default, little endian

public final boolean
public static final Platform.CPUType
MIPS_32

MIPS 32bit, big endian (mips) or little endian (mipsel)

public static final Platform.CPUType
MIPS_64

MIPS 64bit, big endian (mips64) or little endian (mipsel64) ?

public static final Platform.CPUType
PA_RISC2_0

PA_RISC2_0 64bit, ???

public static final Platform.CPUType
PPC

PPC 32bit default, usually big endian

public static final Platform.CPUType
PPC64

PPC 64bit default, usually big endian

public static final Platform.CPUType
SPARC_32

SPARC 32bit, big endian

public static final Platform.CPUType
SPARCV9_64

SPARC 64bit, big endian

public static final Platform.CPUType
SuperH

Hitachi SuperH 32bit default, ???

public static final Platform.CPUType
X86_32

X86 32bit, little endian

public static final Platform.CPUType
X86_64

X86 64bit, little endian

Constructor Summary

AccessConstructor and Description
private
CPUType(final Platform.CPUFamily type, final boolean is32Bit)

Method Summary

Modifier and TypeMethod and Description
public final boolean
isCompatible(final Platform.CPUType other)

Returns true if the given CPUType is compatible w/ this one, i.e. at least family and is32Bit is equal.

public static final Platform.CPUType
query(final String cpuABILower)

public static Platform.CPUType
public static Platform.CPUType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ARMback to summary
public static final Platform.CPUType ARM

ARM 32bit default, usually little endian

ARM64back to summary
public static final Platform.CPUType ARM64

ARM64 default (64bit), usually little endian

ARMv5back to summary
public static final Platform.CPUType ARMv5

ARM7EJ, ARM9E, ARM10E, XScale, usually little endian

ARMv6back to summary
public static final Platform.CPUType ARMv6

ARM11, usually little endian

ARMv7back to summary
public static final Platform.CPUType ARMv7

ARM Cortex, usually little endian

ARMv8_Aback to summary
public static final Platform.CPUType ARMv8_A

ARM AArch64 (64bit), usually little endian

familyback to summary
public final Platform.CPUFamily family
IA64back to summary
public static final Platform.CPUType IA64

Itanium 64bit default, little endian

is32Bitback to summary
public final boolean is32Bit
MIPS_32back to summary
public static final Platform.CPUType MIPS_32

MIPS 32bit, big endian (mips) or little endian (mipsel)

MIPS_64back to summary
public static final Platform.CPUType MIPS_64

MIPS 64bit, big endian (mips64) or little endian (mipsel64) ?

PA_RISC2_0back to summary
public static final Platform.CPUType PA_RISC2_0

PA_RISC2_0 64bit, ??? endian

PPCback to summary
public static final Platform.CPUType PPC

PPC 32bit default, usually big endian

PPC64back to summary
public static final Platform.CPUType PPC64

PPC 64bit default, usually big endian

SPARC_32back to summary
public static final Platform.CPUType SPARC_32

SPARC 32bit, big endian

SPARCV9_64back to summary
public static final Platform.CPUType SPARCV9_64

SPARC 64bit, big endian

SuperHback to summary
public static final Platform.CPUType SuperH

Hitachi SuperH 32bit default, ??? endian

X86_32back to summary
public static final Platform.CPUType X86_32

X86 32bit, little endian

X86_64back to summary
public static final Platform.CPUType X86_64

X86 64bit, little endian

Constructor Detail

CPUTypeback to summary
private CPUType(final Platform.CPUFamily type, final boolean is32Bit)

Method Detail

isCompatibleback to summary
public final boolean isCompatible(final Platform.CPUType other)

Returns true if the given CPUType is compatible w/ this one, i.e. at least family and is32Bit is equal.

queryback to summary
public static final Platform.CPUType query(final String cpuABILower)
valueOfback to summary
public static Platform.CPUType valueOf(String name)
valuesback to summary
public static Platform.CPUType[] values()
com.jogamp.common.os back to summary

public final Enum Platform.OSType

extends Enum<Platform.OSType>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final Platform.OSType
public static final Platform.OSType
public static final Platform.OSType
public static final Platform.OSType
public static final Platform.OSType
public static final Platform.OSType
public static final Platform.OSType
public static final Platform.OSType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Platform.OSType
public static Platform.OSType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ANDROIDback to summary
public static final Platform.OSType ANDROID
FREEBSDback to summary
public static final Platform.OSType FREEBSD
HPUXback to summary
public static final Platform.OSType HPUX
LINUXback to summary
public static final Platform.OSType LINUX
MACOSback to summary
public static final Platform.OSType MACOS
OPENKODEback to summary
public static final Platform.OSType OPENKODE
SUNOSback to summary
public static final Platform.OSType SUNOS
WINDOWSback to summary
public static final Platform.OSType WINDOWS

Constructor Detail

OSTypeback to summary
private OSType()

Method Detail

valueOfback to summary
public static Platform.OSType valueOf(String name)
valuesback to summary
public static Platform.OSType[] values()