twaver.event
Class Listener<E extends Event>

java.lang.Object
  extended by twaver.event.Listener<E>
Type Parameters:
E - 事件类型
All Implemented Interfaces:
IListener<E>
Direct Known Subclasses:
ListEventListener

public class Listener<E extends Event>
extends java.lang.Object
implements IListener<E>

监听器


Constructor Summary
Listener()
           
 
Method Summary
 boolean beforeEvent(E event)
          事件发生前,返回false表示中断事件,用于操作前的检测
 void onEvent(E event)
          事件发生时回调
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Listener

public Listener()
Method Detail

beforeEvent

public boolean beforeEvent(E event)
Description copied from interface: IListener
事件发生前,返回false表示中断事件,用于操作前的检测

Specified by:
beforeEvent in interface IListener<E extends Event>
Parameters:
event - 事件
Returns:
false表示中断事件

onEvent

public void onEvent(E event)
Description copied from interface: IListener
事件发生时回调

Specified by:
onEvent in interface IListener<E extends Event>
Parameters:
event - 事件