Package org.deckfour.xes.model.impl
Class XEventImpl
- java.lang.Object
-
- org.deckfour.xes.model.impl.XEventImpl
-
- All Implemented Interfaces:
java.lang.Cloneable,XAttributable,XElement,XEvent
public class XEventImpl extends java.lang.Object implements XEvent
Implementation for the XEvent interface.- Author:
- Christian W. Guenther (christian@deckfour.org)
-
-
Constructor Summary
Constructors Constructor Description XEventImpl()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 attributedXEventImpl(XAttributeMap attributes)Creates a new event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(XVisitor visitor, XTrace trace)java.lang.Objectclone()Clones this event, i.e.booleanequals(java.lang.Object o)Tests for equality of IDsXAttributeMapgetAttributes()Retrieves the attributes set for this element.java.util.Set<XExtension>getExtensions()Retrieves the extensions used by this element, i.e.XIDgetID()Returns the id of the eventbooleanhasAttributes()Checks for the existence of attributes.inthashCode()Returns the hashCode of the idvoidsetAttributes(XAttributeMap attributes)Sets the map of attributes for this element.voidsetID(XID id)Sets the ID.
-
-
-
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 eventattributes- Map of attribute for the event.
-
-
Method Detail
-
getAttributes
public XAttributeMap getAttributes()
Description copied from interface:XAttributableRetrieves the attributes set for this element.- Specified by:
getAttributesin interfaceXAttributable- Returns:
- A map of attributes.
-
setAttributes
public void setAttributes(XAttributeMap attributes)
Description copied from interface:XAttributableSets the map of attributes for this element.- Specified by:
setAttributesin interfaceXAttributable- Parameters:
attributes- A map of attributes.
-
hasAttributes
public boolean hasAttributes()
Description copied from interface:XAttributableChecks for the existence of attributes. This method can be a more efficient way of checking for the existance of attributes than usingXAttributable.getAttributes()in certain situations.- Specified by:
hasAttributesin interfaceXAttributable- Returns:
- whether this element has any attributes
-
getExtensions
public java.util.Set<XExtension> getExtensions()
Description copied from interface:XAttributableRetrieves the extensions used by this element, i.e. the extensions used by all attributes of this element, and the element itself.- Specified by:
getExtensionsin interfaceXAttributable- Returns:
- A set of extensions.
-
clone
public java.lang.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
-
equals
public boolean equals(java.lang.Object o)
Tests for equality of IDs- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Returns the hashCode of the id- Overrides:
hashCodein classjava.lang.Object
-
setID
public void setID(XID id)
Sets the ID. Should only be used for deserialization purposes- Parameters:
id- the new id.
-
-