Class DepthFirstExpandCollection<N>
- java.lang.Object
-
- org.processmining.framework.util.search.DepthFirstExpandCollection<N>
-
- All Implemented Interfaces:
ExpandCollection<N>
- Direct Known Subclasses:
BreadthFirstExpandCollection
public class DepthFirstExpandCollection<N> extends java.lang.Object implements ExpandCollection<N>
-
-
Constructor Summary
Constructors Constructor Description DepthFirstExpandCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.util.Collection<? extends N> newElements)Adds the given elements to the collection.booleanisEmpty()Checks whether or not the collection retained by this ExpandCollection is empty.Npop()Gets and removes the first element to be expanded by the node expander.
-
-
-
Field Detail
-
stack
protected java.util.Stack<N> stack
-
-
Method Detail
-
add
public void add(java.util.Collection<? extends N> newElements)
Description copied from interface:ExpandCollectionAdds the given elements to the collection. Note that implementing classes may safely assume that the calling thread owns the monitor, i.e. there is no need to synchronize on the collection retained by this expandcollection and removals are allowed. Furthermore, the implementing class may decide not to include any of the given newElements if it decides that they are not to be investigated further.- Specified by:
addin interfaceExpandCollection<N>- Parameters:
newElements- the nodes to expand further
-
pop
public N pop()
Description copied from interface:ExpandCollectionGets and removes the first element to be expanded by the node expander. Implementing classes may assume that isEmpty() returns false before any call to pop, i.e. the first line of the implementation can be:assert (!isEmpty())- Specified by:
popin interfaceExpandCollection<N>- Returns:
- the first element to be investigated by the searcher.
-
isEmpty
public boolean isEmpty()
Description copied from interface:ExpandCollectionChecks whether or not the collection retained by this ExpandCollection is empty. If this method returns false, a call to pop() can be made.- Specified by:
isEmptyin interfaceExpandCollection<N>- Returns:
-
-