Class ArchUtils


  • public class ArchUtils
    extends java.lang.Object
    An utility class for the os.arch System Property. The class defines methods for identifying the architecture of the current JVM.

    Important: The os.arch System Property returns the architecture used by the JVM not of the operating system.

    Since:
    3.6
    • Field Detail

      • ARCH_TO_PROCESSOR

        private static final java.util.Map<java.lang.String,​Processor> ARCH_TO_PROCESSOR
    • Constructor Detail

      • ArchUtils

        public ArchUtils()
    • Method Detail

      • init

        private static void init()
      • init_X86_32Bit

        private static void init_X86_32Bit()
      • init_X86_64Bit

        private static void init_X86_64Bit()
      • init_IA64_32Bit

        private static void init_IA64_32Bit()
      • init_IA64_64Bit

        private static void init_IA64_64Bit()
      • init_PPC_32Bit

        private static void init_PPC_32Bit()
      • init_PPC_64Bit

        private static void init_PPC_64Bit()
      • addProcessor

        private static void addProcessor​(java.lang.String key,
                                         Processor processor)
        Adds the given Processor with the given key String to the map.
        Parameters:
        key - The key as String.
        processor - The Processor to add.
        Throws:
        java.lang.IllegalStateException - If the key already exists.
      • addProcessors

        private static void addProcessors​(Processor processor,
                                          java.lang.String... keys)
        Adds the given Processor with the given keys to the map.
        Parameters:
        keys - The keys.
        processor - The Processor to add.
        Throws:
        java.lang.IllegalStateException - If the key already exists.
      • getProcessor

        public static Processor getProcessor()
        Returns a Processor object of the current JVM.

        Important: The os.arch System Property returns the architecture used by the JVM not of the operating system.

        Returns:
        A Processor when supported, else null.
      • getProcessor

        public static Processor getProcessor​(java.lang.String value)
        Returns a Processor object the given value String. The String must be like a value returned by the os.arch System Property.
        Parameters:
        value - A String like a value returned by the os.arch System Property.
        Returns:
        A Processor when it exists, else null.