private String displayName
private int battery
private int currentBattery
+ private int batteryLatestValue
Battery(String id, String label, String displayName, int battery) {
this.id = id
this.displayName = displayName
this.battery = battery
this.currentBattery = battery
+ this.batteryLatestValue = battery
}
//By Model Checker
println("the battery level with id:$id is changed to $value!")
this.battery = value.toInteger()
this.currentBattery = value.toInteger()
+ this.batteryLatestValue = value.toInteger()
}
def currentValue(String deviceFeature) {
}
}
+ def latestValue(String deviceFeature) {
+ if (deviceFeature == "battery") {
+ return batteryLatestValue
+ }
+ }
+
}