Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
Event | 27 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package org.xwiki.observation.event; | |
21 | ||
22 | /** | |
23 | * All Event types must implement this interface. | |
24 | * | |
25 | * @version $Id: 25fca8d31c8f10e4ba76edee766742e4c52ac310 $ | |
26 | */ | |
27 | public interface Event | |
28 | { | |
29 | /** | |
30 | * Compares two events to see if they <em>match</em>, meaning that a listener that registered to receive | |
31 | * notifications <em>like</em> <code>referenceEvent</code> will be notified of any occuring event for which | |
32 | * <code>referenceEvent.matches(occuringEvent)</code> will return <code>true</code>. The matching algorithm depends | |
33 | * on the event implementation. For example for Document events two events match if they implement the same event | |
34 | * class and if their {@link org.xwiki.observation.event.filter.EventFilter} match. Note that the implementation is | |
35 | * left open in order to cater for all the possible ways this Observation component can be used. | |
36 | * | |
37 | * @param otherEvent the occuring event matched against the current object | |
38 | * @return <code>true</code> if the passed event matches this event, <code>false</code> otherwise. | |
39 | */ | |
40 | boolean matches(Object otherEvent); | |
41 | } |