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) |
| 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.
|
javax.json.JsonObject |
toJSON()
Creates a compact JSON string containing the information for this class
|
protected String name
protected double remainingCapacity
protected double timeRemaining
public AbstractPowerSource(String newName, double newRemainingCapacity, double newTimeRemaining)
public String getName()
getName in interface PowerSourcepublic double getRemainingCapacity()
getRemainingCapacity in interface PowerSourcepublic double getTimeRemaining()
getTimeRemaining in interface PowerSourcepublic javax.json.JsonObject toJSON()
toJSON in interface OshiJsonObjectCopyright © 2010–2016 com.github.dblock. All rights reserved.