- //By Model Checker
- def setValue(LinkedHashMap eventDataMap) {
- if (eventDataMap["value"] != sleepSensors[0].sleeping) {
- this.sleeping = eventDataMap["value"]
- sleepSensors[0].setValue(eventDataMap["value"])
- sendEvent(eventDataMap)
- }
- }
-
- //Methods for closures
- def count(Closure Input) {
- sleepSensors.count(Input)
- }
- def size() {
- sleepSensors.size()
- }
- def each(Closure Input) {
- sleepSensors.each(Input)
- }
- def find(Closure Input) {
- sleepSensors.find(Input)
- }
- def sort(Closure Input) {
- sleepSensors.sort(Input)
- }
- def collect(Closure Input) {
- sleepSensors.collect(Input)
- }
-
- def getAt(int ix) {
- sleepSensors[ix]
+ // Methods to return values
+ def getCurrentSleeping() {
+ List tmpValues = new ArrayList()
+ tmpValues.add(sleepSensors[0].getCurrentSleeping())
+ return tmpValues