Package com.helger.commons.system
Enum EProcessorArchitecture
- java.lang.Object
-
- java.lang.Enum<EProcessorArchitecture>
-
- com.helger.commons.system.EProcessorArchitecture
-
- All Implemented Interfaces:
Serializable,Comparable<EProcessorArchitecture>
public enum EProcessorArchitecture extends Enum<EProcessorArchitecture>
Enum for representing the current processor architecture. Works only on Sun JVMs using the proprietary system propertysun.arch.data.model.- Author:
- Philip Helger
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EProcessorArchitectureforBits(int nBits)Get the processor architecture based on the passed number of bits.intgetBits()intgetBytes()static EProcessorArchitecturegetCurrentArchitecture()static intgetCurrentArchitectureBits()static EProcessorArchitecturevalueOf(String name)Returns 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 Detail
-
UNKNOWN
public static final EProcessorArchitecture UNKNOWN
Unknown architecture - could not be determined.
-
ARCH_32
public static final EProcessorArchitecture ARCH_32
32 bit architecture.
-
ARCH_64
public static final EProcessorArchitecture ARCH_64
64 bit architecture.
-
-
Method Detail
-
values
public static EProcessorArchitecture[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (EProcessorArchitecture c : EProcessorArchitecture.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EProcessorArchitecture valueOf(String name)
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
@CheckForSigned public static int getCurrentArchitectureBits()
- Returns:
- The number of bits in the current architecture or
CGlobal.ILLEGAL_UINTif this is undetermined.
-
forBits
@Nonnull public static EProcessorArchitecture forBits(int nBits)
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
@Nonnull public static EProcessorArchitecture getCurrentArchitecture()
- Returns:
- The current processor architecture if running inside a Sun JVM. If
no processor architecture could be determined,
UNKNOWNis returned and nevernull.
-
-