org.processmining.framework.log.rfb
Class LightweightModelElements

java.lang.Object
  extended by org.processmining.framework.log.rfb.LightweightModelElements
All Implemented Interfaces:
ModelElements

public class LightweightModelElements
extends java.lang.Object
implements ModelElements

This class implements a set of model elements, as found in a log file or process instance, as a dynamic structure of lightweight proxies for elements and iterators.

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

Nested Class Summary
protected  class LightweightModelElements.LightweightModelElement
          Lightweight proxy class implementing a model element in the lighweight set.
protected  class LightweightModelElements.LightweightModelElementIterator
          Typical lightweight iterator over a set of model elements.
 
Field Summary
protected  java.util.ArrayList<java.lang.String> elements
          Contains the actual model elements as strings.
protected  int iteratorPosition
          Deprecated. subject to removal (iterator interface deprecated)
protected  java.util.HashSet<ProcessInstance> processInstances
          The process instance(s) this set of model elements refers to
 
Constructor Summary
LightweightModelElements(java.util.ArrayList<java.lang.String> elementNames, java.util.HashSet<ProcessInstance> instances)
          Creates a new set of model elements.
LightweightModelElements(java.util.HashSet<ProcessInstance> instances)
          Creates a new empty set of model elements.
 
Method Summary
 void addElement(java.lang.String element)
          Adds a model element with the given name to the set.
 ModelElement find(java.lang.String element)
          Retrieves a model element from this set.
 ModelElement first()
          Retrieves the first model element in this set.
 ModelElement get(int index)
          Retrieves a model element contained in this set at the specific index.
protected  java.util.Set<AuditTrailEntry> getInstancesForModelElement(int index)
          Retrieves the set of audit trail entries which are instances of the indexed model element contained in this set.
 java.util.ArrayList<java.lang.String> getModelElementStrings()
          Retrieves the set of model elements as a list of strings.
 boolean hasNext()
          Iterator method.
 java.util.Iterator iterator()
          Retrieves an iterator over the ModelElement instances contained in this set.
 ModelElement last()
          Retrieves the last model element in this set.
 void merge(LightweightModelElements mergeElements)
          Merges this set of model elements with another one, thus rendering the instance on which this method is invoked the union of its prior set and the set of elements to be merged with.
 ModelElement next()
          Iterator method.
 void reset()
          Iterator method.
 int size()
          Retrieves the number of model elements contained in this set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.processmining.framework.log.ModelElements
toString
 

Field Detail

elements

protected java.util.ArrayList<java.lang.String> elements
Contains the actual model elements as strings.


processInstances

protected java.util.HashSet<ProcessInstance> processInstances
The process instance(s) this set of model elements refers to


iteratorPosition

protected int iteratorPosition
Deprecated. subject to removal (iterator interface deprecated)
Legacy iterator implementation; holds built-in iterator's position.

Constructor Detail

LightweightModelElements

public LightweightModelElements(java.util.ArrayList<java.lang.String> elementNames,
                                java.util.HashSet<ProcessInstance> instances)
Creates a new set of model elements.

Parameters:
elementNames - List of model elements as strings.
instances - The set of process instances this set refers to

LightweightModelElements

public LightweightModelElements(java.util.HashSet<ProcessInstance> instances)
Creates a new empty set of model elements.

Parameters:
instances - The set of process instances this set refers to
Method Detail

merge

public void merge(LightweightModelElements mergeElements)
Merges this set of model elements with another one, thus rendering the instance on which this method is invoked the union of its prior set and the set of elements to be merged with.

Parameters:
mergeElements - Set of elements to be merged with.

getModelElementStrings

public java.util.ArrayList<java.lang.String> getModelElementStrings()
Retrieves the set of model elements as a list of strings.

Returns:

addElement

public void addElement(java.lang.String element)
Adds a model element with the given name to the set.

Parameters:
element - Name of the model element to be added.

find

public ModelElement find(java.lang.String element)
Description copied from interface: ModelElements
Retrieves a model element from this set.

Specified by:
find in interface ModelElements
Parameters:
element - Name of the model element.
Returns:
The requested model element, if found; null otherwise.

first

public ModelElement first()
Description copied from interface: ModelElements
Retrieves the first model element in this set.

Specified by:
first in interface ModelElements
Returns:
The first model element in this set.

last

public ModelElement last()
Description copied from interface: ModelElements
Retrieves the last model element in this set.

Specified by:
last in interface ModelElements
Returns:
The last model element in this set.

get

public ModelElement get(int index)
Description copied from interface: ModelElements
Retrieves a model element contained in this set at the specific index.

Specified by:
get in interface ModelElements
Parameters:
index - Index of the requested model element in this set.
Returns:
The requested model element.

iterator

public java.util.Iterator iterator()
Description copied from interface: ModelElements
Retrieves an iterator over the ModelElement instances contained in this set.

Specified by:
iterator in interface ModelElements
Returns:
An iterator over the model elements contained.

hasNext

public boolean hasNext()
Description copied from interface: ModelElements
Iterator method. deprecated!

Specified by:
hasNext in interface ModelElements

next

public ModelElement next()
Description copied from interface: ModelElements
Iterator method. deprecated!

Specified by:
next in interface ModelElements

reset

public void reset()
Description copied from interface: ModelElements
Iterator method. deprecated!

Specified by:
reset in interface ModelElements

size

public int size()
Description copied from interface: ModelElements
Retrieves the number of model elements contained in this set.

Specified by:
size in interface ModelElements
Returns:
The number of model elements contained in this set.

getInstancesForModelElement

protected java.util.Set<AuditTrailEntry> getInstancesForModelElement(int index)
Retrieves the set of audit trail entries which are instances of the indexed model element contained in this set.

Parameters:
index -
Returns: