org.deckfour.xes.extension.std
Class XTimeExtension

java.lang.Object
  extended by org.deckfour.xes.extension.XExtension
      extended by org.deckfour.xes.extension.std.XTimeExtension

public class XTimeExtension
extends XExtension

This extension defines the Time perspective on event logs. It makes it possible to assign to each event a timestamp, describing when the event has occurred.

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

Field Summary
static XAttributeTimestamp ATTR_TIMESTAMP
          Timestamp attribute prototype.
static URI EXTENSION_URI
          Unique URI of this extension.
static String KEY_TIMESTAMP
          Key for the timestamp attribute.
 
Fields inherited from class org.deckfour.xes.extension.XExtension
allAttributes, eventAttributes, logAttributes, metaAttributes, name, prefix, traceAttributes, uri
 
Method Summary
 void assignTimestamp(XEvent event, Date timestamp)
          Assigns to a given event its timestamp.
 void assignTimestamp(XEvent event, long time)
          Assigns to a given event its timestamp.
 Date extractTimestamp(XEvent event)
          Extracts from a given event the timestamp.
static XTimeExtension instance()
          Provides access to the singleton instance of this extension.
 
Methods inherited from class org.deckfour.xes.extension.XExtension
equals, getDefinedAttributes, getEventAttributes, getLogAttributes, getMetaAttributes, getName, getPrefix, getTraceAttributes, getUri, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EXTENSION_URI

public static final URI EXTENSION_URI
Unique URI of this extension.


KEY_TIMESTAMP

public static final String KEY_TIMESTAMP
Key for the timestamp attribute.

See Also:
Constant Field Values

ATTR_TIMESTAMP

public static XAttributeTimestamp ATTR_TIMESTAMP
Timestamp attribute prototype.

Method Detail

instance

public static XTimeExtension instance()
Provides access to the singleton instance of this extension.

Returns:
The Time extension singleton.

extractTimestamp

public Date extractTimestamp(XEvent event)
Extracts from a given event the timestamp.

Parameters:
event - Event to be queried.
Returns:
The timestamp of this event, as a Date object (may be null if not defined).

assignTimestamp

public void assignTimestamp(XEvent event,
                            Date timestamp)
Assigns to a given event its timestamp.

Parameters:
event - Event to be modified.
timestamp - Timestamp, as a Date object.

assignTimestamp

public void assignTimestamp(XEvent event,
                            long time)
Assigns to a given event its timestamp.

Parameters:
event - Event to be modified.
time - Timestamp, as a long of milliseconds in UNIX time.