public abstract class EventHandler extends Object implements Comparable<EventHandler>
EventBus that is able to dispatch
an event.
Original for Guava, licensed under the Apache License, Version 2.0.
| Modifier and Type | Class and Description |
|---|---|
static class |
EventHandler.Priority |
| Modifier | Constructor and Description |
|---|---|
protected |
EventHandler(EventHandler.Priority priority)
Create a new event handler.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(EventHandler o) |
abstract void |
dispatch(Object event)
Dispatch the event.
|
abstract boolean |
equals(Object obj) |
EventHandler.Priority |
getPriority()
Get the priority.
|
void |
handleEvent(Object event)
Dispatch the given event.
|
abstract int |
hashCode() |
String |
toString() |
protected EventHandler(EventHandler.Priority priority)
priority - the prioritypublic EventHandler.Priority getPriority()
public final void handleEvent(Object event) throws InvocationTargetException
Subclasses should override dispatch(Object).
event - the eventInvocationTargetException - thrown if an exception is thrown during dispatchpublic abstract void dispatch(Object event) throws Exception
event - the event objectException - an exception that may be thrownpublic int compareTo(EventHandler o)
compareTo in interface Comparable<EventHandler>Copyright © 2010-2014. All Rights Reserved.