org.bukkit.plugin
Class TimedRegisteredListener

java.lang.Object
  extended by org.bukkit.plugin.RegisteredListener
      extended by org.bukkit.plugin.TimedRegisteredListener

public class TimedRegisteredListener
extends RegisteredListener

Extends RegisteredListener to include timing information


Constructor Summary
TimedRegisteredListener(Listener pluginListener, EventExecutor eventExecutor, EventPriority eventPriority, Plugin registeredPlugin, boolean listenCancelled)
           
 
Method Summary
 void callEvent(Event event)
          Calls the event executor
 int getCount()
          Gets the total times this listener has been called
 Class<? extends Event> getEventClass()
          Gets the class of the events this listener handled.
 long getTotalTime()
          Gets the total time calls to this listener have taken
 boolean hasMultiple()
          Gets whether this listener has handled multiple events, such that for some two events, eventA.getClass() != eventB.getClass().
 void reset()
          Resets the call count and total time for this listener
 
Methods inherited from class org.bukkit.plugin.RegisteredListener
getListener, getPlugin, getPriority, isIgnoringCancelled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimedRegisteredListener

public TimedRegisteredListener(Listener pluginListener,
                               EventExecutor eventExecutor,
                               EventPriority eventPriority,
                               Plugin registeredPlugin,
                               boolean listenCancelled)
Method Detail

callEvent

public void callEvent(Event event)
               throws EventException
Description copied from class: RegisteredListener
Calls the event executor

Overrides:
callEvent in class RegisteredListener
Parameters:
event - The event
Throws:
EventException - If an event handler throws an exception.

reset

public void reset()
Resets the call count and total time for this listener


getCount

public int getCount()
Gets the total times this listener has been called

Returns:
Times this listener has been called

getTotalTime

public long getTotalTime()
Gets the total time calls to this listener have taken

Returns:
Total time for all calls of this listener

getEventClass

public Class<? extends Event> getEventClass()
Gets the class of the events this listener handled. If it handled multiple classes of event, the closest shared superclass will be returned, such that for any event this listener has handled, this.getEventClass().isAssignableFrom(event.getClass()) and no class this.getEventClass().isAssignableFrom(clazz) && this.getEventClass() != clazz && event.getClass().isAssignableFrom(clazz) for all handled events.

Returns:
the event class handled by this RegisteredListener

hasMultiple

public boolean hasMultiple()
Gets whether this listener has handled multiple events, such that for some two events, eventA.getClass() != eventB.getClass().

Returns:
true if this listener has handled multiple events


Copyright © 2013. All Rights Reserved.