- All Implemented Interfaces:
Serializable,Comparable<CPU>,Constable
Enumerated type for CPU types.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionaarch64, also known asarm64.arm, also known asarmv7, etc.MIPS 32-bit (big-endian).MIPS 64-bit (big-endian).MIPS 64-bit (little-endian).MIPS 32-bit (little-endian).PowerPC 64-bit (big-endian).PowerPC 32-bit (big-endian).PowerPC 32-bit (little-endian).PowerPC 64-bit (little-endian).riscv.S390.An unknown 32-bit little-endian CPU.An unknown 32-bit big-endian CPU.An unknown 64-bit little-endian CPU.An unknown 64-bit big-endian CPU.WebAssembly 32-bit.Intel/AMD 64-bitx64architecture.Intel 32-bitx86architecture. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaliases()Returns other names that this CPU is known by.static CPUNames are compared case-insensitively.forNameOpt(String name) Names are compared case-insensitively.static CPUforNameOrNull(String name) Names are compared case-insensitively.static CPUhost()Returns the host CPU type.booleanReturnstrueif this CPU is unknown.Returns this CPU's native byte order.intReturns this CPU's pointer size, in bits.intReturns this CPU's pointer size, in bytes.static CPUReturns the enum constant of this class with the specified name.static CPU[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
unknown32
An unknown 32-bit little-endian CPU. -
unknown32be
An unknown 32-bit big-endian CPU. -
unknown64
An unknown 64-bit little-endian CPU. -
unknown64be
An unknown 64-bit big-endian CPU. -
x64
Intel/AMD 64-bitx64architecture. -
x86
Intel 32-bitx86architecture. -
aarch64
aarch64, also known asarm64. -
arm
arm, also known asarmv7, etc. -
riscv
riscv. -
ppc32
PowerPC 32-bit (big-endian). -
ppc32le
PowerPC 32-bit (little-endian). -
ppc
PowerPC 64-bit (big-endian). -
ppcle
PowerPC 64-bit (little-endian). -
wasm32
WebAssembly 32-bit. -
s390
S390. -
mips
MIPS 32-bit (big-endian). -
mipsel
MIPS 32-bit (little-endian). -
mips64
MIPS 64-bit (big-endian). -
mips64el
MIPS 64-bit (little-endian).
-
-
Field Details
-
values
All of the possible CPU values, in order.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
pointerSizeBytes
public int pointerSizeBytes()Returns this CPU's pointer size, in bytes.- Returns:
- this CPU's pointer size, in bytes
-
pointerSizeBits
public int pointerSizeBits()Returns this CPU's pointer size, in bits.- Returns:
- this CPU's pointer size, in bits
-
nativeByteOrder
Returns this CPU's native byte order.- Returns:
- this CPU's native byte order
-
aliases
Returns other names that this CPU is known by.- Returns:
- other names that this CPU is known by
-
isUnknown
public boolean isUnknown()Returnstrueif this CPU is unknown.- Returns:
trueif this CPU is unknown
-
forName
Names are compared case-insensitively.- Parameters:
name- aStringfor the CPU name- Returns:
- the CPU for the given name
- Throws:
NoSuchElementException- if no such CPU is found
-
forNameOrNull
Names are compared case-insensitively.- Parameters:
name- aStringfor the CPU name- Returns:
- the CPU for the given name or
nullif it is not found - Throws:
NoSuchElementException
-
forNameOpt
Names are compared case-insensitively.- Parameters:
name- aStringfor the CPU name- Returns:
- the optional CPU for the given name
- Throws:
NoSuchElementException
-
host
Returns the host CPU type.- Returns:
- the host CPU type
-