org.processmining.mining.dmcscanning
Class DmcSet

java.lang.Object
  extended by org.processmining.mining.dmcscanning.DmcSet
All Implemented Interfaces:
java.lang.Comparable, LogItem

public class DmcSet
extends java.lang.Object
implements LogItem

DMCSet provides an ordered and structured way to store and access a set of DMCs. Typical usage is intended to cover the management of initially scanned DMCs in a way that provides for automatically created structure, to ease later access and search.

Author:
Christian W. Guenther (christian at deckfour dot org)

Field Summary
protected  java.util.TreeSet<Dmc> allDMCs
          the arraylist allDMCs is to contain references to all DMCs contained in the order of their having been added.
protected  long dmcCounter
           
protected  java.util.Date leftBoundaryTime
           
protected  java.util.HashMap<java.lang.String,java.util.HashMap> processes
           
protected  java.util.Date rightBoundaryTime
           
 
Constructor Summary
DmcSet()
          constructor
 
Method Summary
 java.util.Iterator allInProcessIterator(java.lang.String processName)
          Convenience method, directly returning an iterator on a collection of all DMCs that belong to the specified process
 double checkConsistency(ObjectEquivalence equiv)
          Debug convenience method: check consistency of all contained DMCs.
 int compareTo(java.lang.Object arg0)
           
 java.util.SortedSet getAll()
           
 java.util.SortedSet getAllInProcess(java.lang.String processName)
          Retrieves a collection of all DMCs stored that belong to the specified process
 java.util.SortedSet getDMCs(ProcessInstance processInstance)
          Returns a list of all DMCs in a given process instance
 java.util.SortedSet getDMCs(java.lang.String processName, java.lang.String processInstanceName)
          Returns a list of all DMCs in a given process instance
 java.util.Iterator getDMCsIterator(ProcessInstance processInstance)
          Convenience method, directly delivering an iterator on all specified DMCs
 java.util.Iterator getDMCsIterator(java.lang.String processName, java.lang.String processInstanceName)
          Convenience method, directly delivering an iterator on all specified DMCs
 java.util.Date getLeftBoundaryTimestamp()
          Start and end position are expected to represent sub-item boundaries of compound log items.
 long getPosition()
          The return value represents the logical position of this log item within the sequence of events (starting from zero and ascending).
 java.util.SortedSet getProcessInstances()
           
 java.util.Date getRightBoundaryTimestamp()
          Start and end position are expected to represent sub-item boundaries of compound log items.
 void insert(Dmc aDmc)
          inserts a new DMC into the data structure (which is built transparently)
 boolean isAtomic()
          Determines, whether this log event is atomic or durable; Atomic, in this context, is interpreted as tStart == tEnd, in contrast to durable, where tStart < tEnd.
 java.util.Iterator iterator()
           
 java.util.Iterator processesIterator()
           
 java.util.Iterator processInstancesIterator(java.lang.String processName)
           
 int size()
           
 void testOutput()
          provides the required test output in pseudo-xml format to Message.TEST
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

allDMCs

protected java.util.TreeSet<Dmc> allDMCs
the arraylist allDMCs is to contain references to all DMCs contained in the order of their having been added. The hashmap processes contains a set of hashmaps that are keyed by the present process ids/names. The value hashmaps inside contain as key the process instance ids and as value arraylists that contain references to the dmcs, belonging to this process instance. Such, the structure is: process->processInstance->DMCs


processes

protected java.util.HashMap<java.lang.String,java.util.HashMap> processes

leftBoundaryTime

protected java.util.Date leftBoundaryTime

rightBoundaryTime

protected java.util.Date rightBoundaryTime

dmcCounter

protected long dmcCounter
Constructor Detail

DmcSet

public DmcSet()
constructor

Method Detail

insert

public void insert(Dmc aDmc)
inserts a new DMC into the data structure (which is built transparently)

Parameters:
aDmc -

getAll

public java.util.SortedSet getAll()
Returns:
an ArrayList with all DMCs contained

iterator

public java.util.Iterator iterator()
Returns:
Iterator on all DMCs contained

getAllInProcess

public java.util.SortedSet getAllInProcess(java.lang.String processName)
Retrieves a collection of all DMCs stored that belong to the specified process

Parameters:
processName -
Returns:

allInProcessIterator

public java.util.Iterator allInProcessIterator(java.lang.String processName)
Convenience method, directly returning an iterator on a collection of all DMCs that belong to the specified process

Parameters:
processName -
Returns:

getDMCs

public java.util.SortedSet getDMCs(java.lang.String processName,
                                   java.lang.String processInstanceName)
Returns a list of all DMCs in a given process instance

Parameters:
processName - name of the process
processInstanceName - id of process instance
Returns:
ArrayList of all specified DMCS

getDMCsIterator

public java.util.Iterator getDMCsIterator(java.lang.String processName,
                                          java.lang.String processInstanceName)
Convenience method, directly delivering an iterator on all specified DMCs

Parameters:
processName - name of the process
processInstanceName - id of the process instance
Returns:
Iterator on all specified DMCs

getDMCs

public java.util.SortedSet getDMCs(ProcessInstance processInstance)
Returns a list of all DMCs in a given process instance

Parameters:
processInstance - reference to a ProcessInstance
Returns:
ArrayList of all specified DMCS

getDMCsIterator

public java.util.Iterator getDMCsIterator(ProcessInstance processInstance)
Convenience method, directly delivering an iterator on all specified DMCs

Parameters:
processInstance - reference to a ProcessInstance
Returns:
Iterator on all specified DMCs

processesIterator

public java.util.Iterator processesIterator()
Returns:
Iterator on the set of all process IDs/names contained

processInstancesIterator

public java.util.Iterator processInstancesIterator(java.lang.String processName)
Parameters:
processName - ID/name of respective process
Returns:
iterator on the set of all process instance IDs contained for that process

size

public int size()
Returns:
the total number of contained DMCs

getProcessInstances

public java.util.SortedSet getProcessInstances()
Returns:
names/ids of all process instances represented by any DMC within the set

getPosition

public long getPosition()
Description copied from interface: LogItem
The return value represents the logical position of this log item within the sequence of events (starting from zero and ascending). If not implemented, return a negative value here.

Specified by:
getPosition in interface LogItem
Returns:

getLeftBoundaryTimestamp

public java.util.Date getLeftBoundaryTimestamp()
Description copied from interface: LogItem
Start and end position are expected to represent sub-item boundaries of compound log items. In case the implementing class represents an atomic log item, the respective start- and end-getters are expected to return an identical value.

Specified by:
getLeftBoundaryTimestamp in interface LogItem
Returns:
the timestamp representing the left boundary of this log item

getRightBoundaryTimestamp

public java.util.Date getRightBoundaryTimestamp()
Description copied from interface: LogItem
Start and end position are expected to represent sub-item boundaries of compound log items. In case the implementing class represents an atomic log item, the respective start- and end-getters are expected to return an identical value.

Specified by:
getRightBoundaryTimestamp in interface LogItem
Returns:
the timestamp representing the right boundary of this log item

compareTo

public int compareTo(java.lang.Object arg0)
Specified by:
compareTo in interface java.lang.Comparable

isAtomic

public boolean isAtomic()
Description copied from interface: LogItem
Determines, whether this log event is atomic or durable; Atomic, in this context, is interpreted as tStart == tEnd, in contrast to durable, where tStart < tEnd.

Specified by:
isAtomic in interface LogItem
Returns:

checkConsistency

public double checkConsistency(ObjectEquivalence equiv)
Debug convenience method: check consistency of all contained DMCs. Returns the consistency ratio: 1.0==completely consistent, 0.0==forget it!

Parameters:
equiv -
Returns:

testOutput

public void testOutput()
provides the required test output in pseudo-xml format to Message.TEST