Package oshi.hardware
Interface PowerSource
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
AbstractPowerSource
,FreeBsdPowerSource
,LinuxPowerSource
,MacPowerSource
,SolarisPowerSource
,WindowsPowerSource
public interface PowerSource extends java.io.Serializable
The Power Source is one or more batteries with some capacity, and some state of charge/discharge- Author:
- widdis[at]gmail[dot]com
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getName()
Name of the power source (e.g., InternalBattery-0)double
getRemainingCapacity()
Remaining capacity as a fraction of max capacity.double
getTimeRemaining()
Estimated time remaining on the power source, in seconds.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Name of the power source (e.g., InternalBattery-0)- Returns:
- The power source name
-
getRemainingCapacity
double getRemainingCapacity()
Remaining capacity as a fraction of max capacity.- Returns:
- A value between 0.0 (fully drained) and 1.0 (fully charged)
-
getTimeRemaining
double getTimeRemaining()
Estimated time remaining on the power source, in seconds.- Returns:
- If positive, seconds remaining. If negative, -1.0 (calculating) or -2.0 (unlimited)
-
-