1 //Create a class for button
3 import Timer.SimulatedTimer
6 import gov.nasa.jpf.vm.Verify
9 private int deviceNumbers
13 //For one device(We cannot have obj.id)-> We should have obj[0].id
14 private String id = "buttonID0"
15 private String label = "button0"
16 private String displayName = "button0"
17 private String button = "pushed"
18 private int numberOfButtons = 4
21 Buttons(Closure sendEvent, int deviceNumbers) {
22 this.sendEvent = sendEvent
23 this.deviceNumbers = deviceNumbers
26 buttons.add(new Button(id, label, displayName, button, numberOfButtons))
30 def setValue(LinkedHashMap eventDataMap) {
31 buttons[0].setValue(eventDataMap)
32 sendEvent(eventDataMap)
35 //Methods for closures
36 def count(Closure Input) {
42 def each(Closure Input) {
45 def sort(Closure Input) {
48 def find(Closure Input) {
51 def collect(Closure Input) {
52 buttons.collect(Input)
57 def eventsSince(Date dateObj) {
58 return buttons[0].eventsSince()