blob: b3c8c00edc524e980bc5ac9c05a16b6685433594 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
/*
* Copyright (c) 2010 Remko Tron¨on
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
/*
* Copyright (c) 2010, Isode Limited, London, England.
* All rights reserved.
*/
package com.isode.stroke.eventloop;
public class Event {
public interface Callback {
void run();
}
Event(EventOwner owner, Callback callback, int id) {
this.owner = owner;
this.callback = callback;
this.id = id;
}
@Override
public boolean equals(Object other) {
if (other instanceof Event) {
return id == ((Event) other).id;
}
return false;
}
@Override
public int hashCode() {
int hash = 7;
hash = 23 * hash + this.id;
return hash;
}
final int id;
final EventOwner owner;
public final Callback callback;
}
|