public abstract class AbstractOperatingSystem extends Object implements OperatingSystem
OperatingSystem.ProcessSort
Modifier and Type | Field and Description |
---|---|
protected int |
bitness |
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.
|
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, wait
getChildProcesses, getFileSystem, getNetworkParams, getProcess, getProcessCount, getProcesses, getProcessId, getThreadCount
protected String manufacturer
protected String family
protected OperatingSystemVersion version
protected int bitness
public OperatingSystemVersion getVersion()
getVersion
in interface OperatingSystem
public String getFamily()
getFamily
in interface OperatingSystem
public String getManufacturer()
getManufacturer
in interface OperatingSystem
protected 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 OperatingSystem
limit
- 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 OperatingSystem
pids
- A collection of process IDsOSProcess
object for the specified
process ids if it is runningpublic int getBitness()
getBitness
in interface OperatingSystem
Copyright © 2010–2021 oshi. All rights reserved.