net.user1.union.core.event
Class BaseEvent

java.lang.Object
  extended by net.user1.union.core.event.BaseEvent
All Implemented Interfaces:
Event
Direct Known Subclasses:
AccountEvent, ClientEvent, ModuleEvent, RemoteRoomEvent, RemoteServerEvent, RoomEvent, ServerEvent, UPCEvent

public abstract class BaseEvent
extends java.lang.Object
implements Event

This is the base class for all events dispatched in the server.


Field Summary
protected  java.util.Map<java.lang.String,java.lang.Object> m_eventProperties
           
 
Constructor Summary
BaseEvent()
          Constructor.
BaseEvent(java.util.Map<java.lang.String,java.lang.Object> props)
          Constructor.
 
Method Summary
 java.lang.Object getProperty(java.lang.String name)
          Gets a named property for the event.
 boolean isCanceled()
          Returns true if the default action is to be prevented.
 void preventDefault()
          Invoking this method on an event will prevent it's default action, if any, from occuring.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_eventProperties

protected java.util.Map<java.lang.String,java.lang.Object> m_eventProperties
Constructor Detail

BaseEvent

public BaseEvent()
Constructor.


BaseEvent

public BaseEvent(java.util.Map<java.lang.String,java.lang.Object> props)
Constructor.

Method Detail

getProperty

public java.lang.Object getProperty(java.lang.String name)
Gets a named property for the event. For example in a ServerEvent.ROOM_CREATE_REQUESTED the RoomDef used for the create room request is retrieved from the property PROP_PASSWORD.

Specified by:
getProperty in interface Event
Parameters:
name - the name of the property
Returns:
a named property for the even

isCanceled

public boolean isCanceled()
Returns true if the default action is to be prevented.

Specified by:
isCanceled in interface Event
Returns:
true if the default action is to be prevented

preventDefault

public void preventDefault()
Invoking this method on an event will prevent it's default action, if any, from occuring. If the event has no default action then this method does nothing.

Specified by:
preventDefault in interface Event


Copyright USER1 Subsystems Corporation - Tue Jan 28 2014, 05:05 PM -0500