/** * Return default OS instance. * @throws UnsupportedOperationException If cannot determine OS. * @return Default instance for the detected OS. */ public static SysInfo newInstance() { if (Shell.LINUX) { return new SysInfoLinux(); } if (Shell.WINDOWS) { return new SysInfoWindows(); } throw new UnsupportedOperationException("Could not determine OS"); }
SysInfoLinux plugin = new SysInfoLinux(); System.out.println("Physical memory Size (bytes) : " + plugin.getPhysicalMemorySize());
public LinuxResourceCalculatorPlugin() { super(new SysInfoLinux()); }
/** * Return default OS instance. * @throws UnsupportedOperationException If cannot determine OS. * @return Default instance for the detected OS. */ public static SysInfo newInstance() { if (Shell.LINUX) { return new SysInfoLinux(); } if (Shell.WINDOWS) { return new SysInfoWindows(); } throw new UnsupportedOperationException("Could not determine OS"); }
SysInfoLinux plugin = new SysInfoLinux(); System.out.println("Physical memory Size (bytes) : " + plugin.getPhysicalMemorySize());