org.deckfour.xes.model.impl
Class XEventImpl

java.lang.Object
  extended by org.deckfour.xes.model.impl.XEventImpl
All Implemented Interfaces:
Cloneable, XAttributable, XElement, XEvent

public class XEventImpl
extends Object
implements XEvent

Implementation for the XEvent interface.

Author:
Christian W. Guenther (christian@deckfour.org)

Constructor Summary
XEventImpl()
          Creates a new event.
XEventImpl(XAttributeMap attributes)
          Creates a new event.
XEventImpl(XID id)
          Creates a new event with a given ID.
XEventImpl(XID id, XAttributeMap attributes)
          Creates a new event with the given id and attributed
 
Method Summary
 void accept(XVisitor visitor, XTrace trace)
           
 Object clone()
          Clones this event, i.e.
 boolean equals(Object o)
          Tests for equality of IDs
 XAttributeMap getAttributes()
          Retrieves the attributes set for this element.
 Set<XExtension> getExtensions()
          Retrieves the extensions used by this element, i.e.
 XID getID()
          Returns the id of the event
 int hashCode()
          Returns the hashCode of the id
 void setAttributes(XAttributeMap attributes)
          Sets the map of attributes for this element.
 void setID(XID id)
          Sets the ID.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XEventImpl

public XEventImpl()
Creates a new event.


XEventImpl

public XEventImpl(XID id)
Creates a new event with a given ID.

Parameters:
id - the id for this event

XEventImpl

public XEventImpl(XAttributeMap attributes)
Creates a new event.

Parameters:
attributes - Map of attribute for the event.

XEventImpl

public XEventImpl(XID id,
                  XAttributeMap attributes)
Creates a new event with the given id and attributed

Parameters:
id - the id for this event
attributes - Map of attribute for the event.
Method Detail

getAttributes

public XAttributeMap getAttributes()
Description copied from interface: XAttributable
Retrieves the attributes set for this element.

Specified by:
getAttributes in interface XAttributable
Returns:
A map of attributes.

setAttributes

public void setAttributes(XAttributeMap attributes)
Description copied from interface: XAttributable
Sets the map of attributes for this element.

Specified by:
setAttributes in interface XAttributable
Parameters:
attributes - A map of attributes.

getExtensions

public Set<XExtension> getExtensions()
Description copied from interface: XAttributable
Retrieves the extensions used by this element, i.e. the extensions used by all attributes of this element, and the element itself.

Specified by:
getExtensions in interface XAttributable
Returns:
A set of extensions.

clone

public Object clone()
Clones this event, i.e. creates a deep copy, but with a new ID, so equals does not hold between this and the clone

Specified by:
clone in interface XElement
Overrides:
clone in class Object
Returns:
An identical clone.

equals

public boolean equals(Object o)
Tests for equality of IDs

Overrides:
equals in class Object

hashCode

public int hashCode()
Returns the hashCode of the id

Overrides:
hashCode in class Object

getID

public XID getID()
Description copied from interface: XEvent
Returns the id of the event

Specified by:
getID in interface XEvent
Returns:
the ID of this event

setID

public void setID(XID id)
Sets the ID. Should only be used for deserialization purposes

Parameters:
id - the new id.

accept

public void accept(XVisitor visitor,
                   XTrace trace)
Specified by:
accept in interface XEvent