public abstract class Platform
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Platform.CPU
The supported CPU architectures.
|
private static class |
Platform.Darwin
A
Platform subclass representing the MacOS system. |
private static class |
Platform.Default |
(package private) static class |
Platform.Linux
A
Platform subclass representing the Linux operating system. |
static class |
Platform.OS
The common names of supported operating systems.
|
private static class |
Platform.SingletonHolder |
private static class |
Platform.Supported |
private static class |
Platform.Unsupported |
private static class |
Platform.Windows
A
Platform subclass representing the Windows system. |
Modifier and Type | Field and Description |
---|---|
private int |
addressSize |
private Platform.CPU |
cpu |
protected java.util.regex.Pattern |
libPattern |
private static java.util.Locale |
LOCALE |
private int |
longSize |
private Platform.OS |
os |
Modifier | Constructor and Description |
---|---|
private |
Platform(Platform.OS os) |
|
Platform(Platform.OS os,
Platform.CPU cpu,
int addressSize,
int longSize,
java.lang.String libPattern) |
Modifier and Type | Method and Description |
---|---|
int |
addressSize()
Deprecated.
Use
Runtime.addressSize() instead. |
private static int |
calculateAddressSize(Platform.CPU cpu) |
private static Platform.CPU |
determineCPU() |
private static Platform.OS |
determineOS()
Determines the operating system jffi is running on
|
private static Platform |
determinePlatform() |
private static Platform |
determinePlatform(Platform.OS os)
Determines the Platform that best describes the OS
|
private static boolean |
equalsIgnoreCase(java.lang.String s1,
java.lang.String s2) |
Platform.CPU |
getCPU()
Gets the current processor architecture the JVM is running on.
|
java.lang.String |
getName()
Gets the name of this Platform.
|
static Platform |
getNativePlatform()
Gets the native Platform
|
Platform.OS |
getOS()
Gets the current Operating System.
|
static Platform |
getPlatform()
Deprecated.
|
java.lang.String |
getStandardCLibraryName()
Returns the platform specific standard C library name
|
boolean |
isBSD() |
boolean |
isUnix() |
java.lang.String |
locateLibrary(java.lang.String libName,
java.util.List<java.lang.String> libraryPath)
Searches through a list of directories for a native library.
|
int |
longSize()
Deprecated.
Use
Runtime.longSize() instead. |
java.lang.String |
mapLibraryName(java.lang.String libName)
Maps from a generic library name (e.g.
|
private static boolean |
startsWithIgnoreCase(java.lang.String s1,
java.lang.String s2) |
private static final java.util.Locale LOCALE
private final Platform.OS os
private final Platform.CPU cpu
private final int addressSize
private final int longSize
protected final java.util.regex.Pattern libPattern
public Platform(Platform.OS os, Platform.CPU cpu, int addressSize, int longSize, java.lang.String libPattern)
private Platform(Platform.OS os)
private static Platform.OS determineOS()
private static Platform determinePlatform(Platform.OS os)
os
- The operating system.private static Platform determinePlatform()
private static Platform.CPU determineCPU()
private static int calculateAddressSize(Platform.CPU cpu)
public static Platform getNativePlatform()
@Deprecated public static Platform getPlatform()
public final Platform.OS getOS()
public final Platform.CPU getCPU()
public final boolean isBSD()
public final boolean isUnix()
public final int longSize()
Runtime.longSize()
instead.public final int addressSize()
Runtime.addressSize()
instead.public java.lang.String getName()
public java.lang.String getStandardCLibraryName()
public java.lang.String mapLibraryName(java.lang.String libName)
libName
- The library name to mappublic java.lang.String locateLibrary(java.lang.String libName, java.util.List<java.lang.String> libraryPath)
libName
- the base name (e.g. "c") of the library to locatelibraryPath
- the list of directories to searchprivate static boolean startsWithIgnoreCase(java.lang.String s1, java.lang.String s2)
private static boolean equalsIgnoreCase(java.lang.String s1, java.lang.String s2)