Class AbstractSensors

    • Field Detail

      • cpuTemperature

        private final java.util.function.Supplier<java.lang.Double> cpuTemperature
      • fanSpeeds

        private final java.util.function.Supplier<int[]> fanSpeeds
      • cpuVoltage

        private final java.util.function.Supplier<java.lang.Double> cpuVoltage
    • Constructor Detail

      • AbstractSensors

        public AbstractSensors()
    • Method Detail

      • getCpuTemperature

        public double getCpuTemperature()
        Description copied from interface: Sensors
        CPU Temperature
        Specified by:
        getCpuTemperature in interface Sensors
        Returns:
        CPU Temperature in degrees Celsius if available, 0 or Double.NaN otherwise.

        On Windows, if not running Open Hardware Monitor, requires elevated permissions and hardware BIOS that supports publishing to WMI. In this case, returns the temperature of the "Thermal Zone" which may be different than CPU temperature obtained from other sources. In addition, some motherboards may only refresh this value on certain events.

      • queryCpuTemperature

        protected abstract double queryCpuTemperature()
      • getFanSpeeds

        public int[] getFanSpeeds()
        Description copied from interface: Sensors
        Fan speeds
        Specified by:
        getFanSpeeds in interface Sensors
        Returns:
        Speed in rpm for all fans. May return empty array if no fans detected or 0 fan speed if unable to measure fan speed.
      • queryFanSpeeds

        protected abstract int[] queryFanSpeeds()
      • getCpuVoltage

        public double getCpuVoltage()
        Description copied from interface: Sensors
        CPU Voltage
        Specified by:
        getCpuVoltage in interface Sensors
        Returns:
        CPU Voltage in Volts if available, 0 otherwise.
      • queryCpuVoltage

        protected abstract double queryCpuVoltage()
      • toString

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