public abstract class AbstractPowerSource extends Object implements PowerSource
| Modifier and Type | Field and Description |
|---|---|
protected String |
name |
protected double |
remainingCapacity |
protected double |
timeRemaining |
| Constructor and Description |
|---|
AbstractPowerSource(String newName,
double newRemainingCapacity,
double newTimeRemaining)
Super constructor used by platform-specific implementations of
PowerSource
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected String name
protected double remainingCapacity
protected double timeRemaining
public AbstractPowerSource(String newName, double newRemainingCapacity, double newTimeRemaining)
newName - The name to assignnewRemainingCapacity - Fraction of remaining capacitynewTimeRemaining - Seconds of time remainingpublic String getName()
getName in interface PowerSourcepublic double getRemainingCapacity()
getRemainingCapacity in interface PowerSourcepublic double getTimeRemaining()
getTimeRemaining in interface PowerSourceCopyright © 2010–2017 oshi. All rights reserved.