Class AbstractOperatingSystem

    • Field Detail

      • manufacturer

        protected java.lang.String manufacturer
      • family

        protected java.lang.String family
      • bitness

        protected int bitness
    • Constructor Detail

      • AbstractOperatingSystem

        public AbstractOperatingSystem()
    • Method Detail

      • getFamily

        public java.lang.String getFamily()
        Operating system family.
        Specified by:
        getFamily in interface OperatingSystem
        Returns:
        String.
      • getManufacturer

        public java.lang.String getManufacturer()
        Manufacturer.
        Specified by:
        getManufacturer in interface OperatingSystem
        Returns:
        String.
      • processSort

        protected java.util.List<OSProcess> processSort​(java.util.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.
        Parameters:
        processes - The array to sort
        limit - The number of results to return if positive; if zero returns all results
        sort - The sorting to use, or null
        Returns:
        An array of size limit (if positive) or of all processes, sorted as specified
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getProcesses

        public OSProcess[] getProcesses​(int limit,
                                        OperatingSystem.ProcessSort sort)
        Gets currently running processes. If a positive limit is specified, returns only that number of processes; zero will return all processes. The order may be specified by the sort parameter, for example, to return the top cpu or memory consuming processes; if null, no order is guaranteed.
        Specified by:
        getProcesses in interface OperatingSystem
        Parameters:
        limit - Max number of results to return, or 0 to return all results
        sort - If not null, determines sorting of results
        Returns:
        An array of OSProcess 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.
      • getProcesses

        public java.util.List<OSProcess> getProcesses​(java.util.Collection<java.lang.Integer> pids)
        Gets information on a currently running processes. This has improved performance on Windows based operating systems vs. iterating individual processes.
        Specified by:
        getProcesses in interface OperatingSystem
        Parameters:
        pids - A collection of process IDs
        Returns:
        An OSProcess object for the specified process ids if it is running
      • getBitness

        public int getBitness()
        Gets the bitness (32 or 64) of the operating system.
        Specified by:
        getBitness in interface OperatingSystem
        Returns:
        The number of bits supported by the operating system.