Package jmri.util

Class SystemType

java.lang.Object
jmri.util.SystemType

public class SystemType extends 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
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    (package private) static String
     
    (package private) static int
     
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    The os.name property
    static int
    Get the integer constant for the OS.
    static boolean
    Convenience method to determine if OS is Linux.
    static boolean
    Convenience method to determine if OS is Mac OS X.
    static boolean
    Convenience method to determine if OS is OS/2.
    static boolean
    Convenience method to determine if OS is Unix.
    static boolean
    Convenience method to determine if OS is Microsoft Windows.
    (package private) static void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • getType

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

      public static 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
    • setType

      static void setType()