Package com.helger.commons.system
Enum EProcessorArchitecture
- All Implemented Interfaces:
Serializable,Comparable<EProcessorArchitecture>,java.lang.constant.Constable
Enum for representing the current processor architecture. Works only on Sun
JVMs using the proprietary system property
sun.arch.data.model.- Author:
- Philip Helger
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic EProcessorArchitectureforBits(int nBits) Get the processor architecture based on the passed number of bits.intgetBits()intgetBytes()static EProcessorArchitecturestatic intstatic EProcessorArchitectureReturns the enum constant of this type with the specified name.static EProcessorArchitecture[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
UNKNOWN
Unknown architecture - could not be determined. -
ARCH_32
32 bit architecture. -
ARCH_64
64 bit architecture.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
getBits
public int getBits()- Returns:
- The number of bits of this architecture. May be
CGlobal.ILLEGAL_UINTfor the unknown architecture.
-
getBytes
public int getBytes()- Returns:
- The number of bytes of this architecture (=bits/8). May be
CGlobal.ILLEGAL_UINTfor the unknown architecture.
-
getCurrentArchitectureBits
- Returns:
- The number of bits in the current architecture or
CGlobal.ILLEGAL_UINTif this is undetermined.
-
forBits
Get the processor architecture based on the passed number of bits.- Parameters:
nBits- The number of bits to get the processor architecture from.- Returns:
UNKNOWNif no processor architecture could be determined.
-
getCurrentArchitecture
- Returns:
- The current processor architecture if running inside a Sun JVM. If
no processor architecture could be determined,
UNKNOWNis returned and nevernull.
-