Class OS


  • public class OS
    extends Object
    Helper class for operating system related stuff.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Field Detail

      • m_IsWindows

        protected static Boolean m_IsWindows
        whether the OS is Windows.
      • m_IsMac

        protected static Boolean m_IsMac
        whether the OS is Mac.
      • m_IsLinux

        protected static Boolean m_IsLinux
        whether the OS is Linux.
      • m_IsAndroid

        protected static Boolean m_IsAndroid
        whether the OS is Android.
      • m_IsArm64

        protected static Boolean m_IsArm64
        whether the architecture is arm64.
    • Constructor Detail

      • OS

        public OS()
    • Method Detail

      • isWindows

        public static boolean isWindows()
        Checks whether the operating system is Windows.
        Returns:
        true if the OS is Windows flavor
      • isMac

        public static boolean isMac()
        Checks whether the operating system is Mac.
        Returns:
        true if the OS is Mac flavor
      • isArm64

        public static boolean isArm64()
        Checks whether the architecture is arm64.
        Returns:
        true if arm64
      • isLinux

        public static boolean isLinux()
        Checks whether the operating system is Linux (but not Android).
        Returns:
        true if the OS is Linux flavor (but not Android)
      • isAndroid

        public static boolean isAndroid()
        Checks whether the operating system is Android.
        Returns:
        true if the OS is Android flavor
      • isOS

        public static boolean isOS​(OS.OperatingSystems os)
        Tests whether the current OS is the same as the provided parameter.
        Parameters:
        os - the OS to test
        Returns:
        true if it is the OS
      • getBitness

        public static int getBitness()
        Returns the "bitness", ie 32 or 64 bit of the underlying OS.
        Returns:
        the number of bits