1 //Create a class for mobile presence
3 import Timer.SimulatedTimer
5 public class MobilePresences {
6 private int deviceNumbers
7 private List mobilePresences
8 private String deviceNetworkId
11 //For one device(We cannot have obj.id)-> We should have obj[0].id
12 private String id = "mobilePresenceID0"
13 private String label = "mobilePresence0"
14 private String displayName = "mobilePresence0"
17 MobilePresences(Closure sendEvent, int deviceNumbers) {
18 this.sendEvent = sendEvent
19 this.deviceNumbers = deviceNumbers
20 this.mobilePresences = []
21 this.deviceNetworkId = "mobile0"
23 mobilePresences.add(new MobilePresence(id, label, displayName, deviceNetworkId))
26 //Methods for closures
27 def count(Closure Input) {
28 mobilePresences.count(Input)
31 mobilePresences.size()
33 def each(Closure Input) {
34 mobilePresences.each(Input)
36 def find(Closure Input) {
37 mobilePresences.find(Input)
39 def sort(Closure Input) {
40 mobilePresences.sort(Input)
42 def collect(Closure Input) {
43 mobilePresences.collect(Input)