|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.kuka.nav.battery.BatteryLevels.BatteryLevelsBuilder
public static class BatteryLevels.BatteryLevelsBuilder
Builder pattern for creating a valid BatteryLevels configuration.
A valid configuration must contain at least one level and all levels must
span the range from 0.0 to 1.0 with a threshold value separating levels.
Levels are added in sequence from lowest to highest level by passing the
upper threshold of the added level. This means that the minimum threshold
of 0.0 is implicitly configured and the last level must have an upper
threshold of 1.0.
| Constructor Summary | |
|---|---|
BatteryLevels.BatteryLevelsBuilder()
|
|
| Method Summary | |
|---|---|
BatteryLevels.BatteryLevelsBuilder |
addLevel(String name,
double threshold)
Adds a new level by passing a name of the level and its upper threshold. |
BatteryLevels.BatteryLevelsBuilder |
addMaximumLevel(String name)
Adds the last and highest state of charge level. |
BatteryLevels |
build()
Finishes the construction of a BatteryLevels.BatteryLevel instance. |
BatteryLevels.BatteryLevelsBuilder |
removeLevel()
Removes the highest configured state of charge level. |
BatteryLevels.BatteryLevelsBuilder |
setName(String levelName,
String newLevelName)
Changes the name of an already configured level. |
BatteryLevels.BatteryLevelsBuilder |
setThreshold(String levelName,
double newThreshold)
Changes the upper threshold of the level with the specified name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BatteryLevels.BatteryLevelsBuilder()
| Method Detail |
|---|
public BatteryLevels.BatteryLevelsBuilder addLevel(String name,
double threshold)
name - a name for the state of charge levelthreshold - the upper threshold of the level, must be higher than the
threshold of the previous level
IllegalArgumentException - if previous threshold is already 1.0 or if the threshold
value is larger than 1.0public BatteryLevels.BatteryLevelsBuilder addMaximumLevel(String name)
#addLevel(name, threshold) with a threshold of 1.0.
name - a name for the highest state of charge level
public BatteryLevels.BatteryLevelsBuilder removeLevel()
public BatteryLevels.BatteryLevelsBuilder setThreshold(String levelName,
double newThreshold)
levelName - the name of levelnewThreshold - the new upper threshold of the level
public BatteryLevels.BatteryLevelsBuilder setName(String levelName,
String newLevelName)
levelName - the previous name of a levelnewLevelName - the new name of the level
public BatteryLevels build()
BatteryLevels.BatteryLevel instance.
IllegalStateException - if the configuration is incomplete
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||