public abstract class AbstractOperatingSystem extends Object implements OperatingSystem
Abstract AbstractOperatingSystem class.
OperatingSystem.ProcessSort| Modifier and Type | Field and Description |
|---|---|
protected int |
bitness |
protected int |
elevated |
protected String |
family |
protected String |
manufacturer |
protected OperatingSystemVersion |
version |
| Constructor and Description |
|---|
AbstractOperatingSystem() |
| Modifier and Type | Method and Description |
|---|---|
int |
getBitness()
Gets the bitness (32 or 64) of the operating system.
|
String |
getFamily()
Operating system family.
|
String |
getManufacturer()
Manufacturer.
|
List<OSProcess> |
getProcesses(Collection<Integer> pids)
Gets information on a currently running processes.
|
OSProcess[] |
getProcesses(int limit,
OperatingSystem.ProcessSort sort)
Gets currently running processes.
|
OperatingSystemVersion |
getVersion()
Operating system version.
|
boolean |
isElevated()
Determine whether the current process has elevated permissions such as sudo /
Administrator
|
protected List<OSProcess> |
processSort(List<OSProcess> processes,
int limit,
OperatingSystem.ProcessSort sort)
Sorts an array of processes using the specified sorting, returning an array
with the top limit results if positive.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetChildProcesses, getFileSystem, getNetworkParams, getProcess, getProcessCount, getProcesses, getProcessId, getSystemBootTime, getSystemUptime, getThreadCountprotected String manufacturer
protected String family
protected OperatingSystemVersion version
protected int bitness
protected int elevated
public OperatingSystemVersion getVersion()
getVersion in interface OperatingSystempublic String getFamily()
getFamily in interface OperatingSystempublic String getManufacturer()
getManufacturer in interface OperatingSystemprotected List<OSProcess> processSort(List<OSProcess> processes, int limit, OperatingSystem.ProcessSort sort)
processes - The array to sortlimit - The number of results to return if positive; if zero returns all
resultssort - The sorting to use, or nullpublic OSProcess[] getProcesses(int limit, OperatingSystem.ProcessSort sort)
getProcesses in interface OperatingSystemlimit - Max number of results to return, or 0 to return all resultssort - If not null, determines sorting of resultsOSProcess objects for the
specified number (or all) of currently running processes, sorted as
specified. The array may contain null elements if a process
terminates during iteration. Some fields that are slow to retrieve
(e.g., group information on Windows, open files on Unix and Linux)
will be skipped.public List<OSProcess> getProcesses(Collection<Integer> pids)
getProcesses in interface OperatingSystempids - A collection of process IDsOSProcess object for the specified
process ids if it is runningpublic int getBitness()
getBitness in interface OperatingSystempublic boolean isElevated()
isElevated in interface OperatingSystemCopyright © 2010–2019 oshi. All rights reserved.