Package jmri.util

Class SystemType


  • public class SystemType
    extends java.lang.Object
    Common utility methods for determining which type of operating system is in use.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static boolean isSet  
      static int LINUX  
      static int MACCLASSIC  
      static int MACOSX  
      static int OS2  
      (package private) static java.lang.String osName  
      (package private) static int type  
      static int UNIX  
      static int WINDOWS  
    • Constructor Summary

      Constructors 
      Constructor Description
      SystemType()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getOSName()
      The os.name property
      static int getType()
      Get the integer constant for the OS.
      static boolean isLinux()
      Convenience method to determine if OS is Linux.
      static boolean isMacOSX()
      Convenience method to determine if OS is Mac OS X.
      static boolean isOS2()
      Convenience method to determine if OS is OS/2.
      static boolean isUnix()
      Convenience method to determine if OS is Unix.
      static boolean isWindows()
      Convenience method to determine if OS is Microsoft Windows.
      (package private) static void setType()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getType

        public static int getType()
        Get the integer constant for the OS. Useful in switch statements.
        Returns:
        Type as an integer
      • getOSName

        public static java.lang.String getOSName()
        The os.name property
        Returns:
        OS name
      • isMacOSX

        public static boolean isMacOSX()
        Convenience method to determine if OS is Mac OS X. Useful if an exception needs to be made for Mac OS X.
        Returns:
        true if on Mac OS X.
      • isLinux

        public static boolean isLinux()
        Convenience method to determine if OS is Linux. Useful if an exception needs to be made for Linux.
        Returns:
        true if on Linux
      • isWindows

        public static boolean isWindows()
        Convenience method to determine if OS is Microsoft Windows. Useful if an exception needs to be made for Microsoft Windows.
        Returns:
        true if on Microsoft Windows
      • isOS2

        public static boolean isOS2()
        Convenience method to determine if OS is OS/2. Useful if an exception needs to be made for OS/2.
        Returns:
        true if on OS/2
      • isUnix

        public static boolean isUnix()
        Convenience method to determine if OS is Unix. Useful if an exception needs to be made for Unix.
        Returns:
        true if on Unix