Package de.saar.chorus.domgraph.chart
Class SolvedFormIterator<E extends GraphBasedNonterminal>
java.lang.Object
de.saar.chorus.domgraph.chart.SolvedFormIterator<E>
- All Implemented Interfaces:
Iterator<SolvedFormSpec>
public class SolvedFormIterator<E extends GraphBasedNonterminal>
extends Object
implements Iterator<SolvedFormSpec>
An iterator over the different solved forms represented by
a
Chart. The chart is passed to the constructor of
an object of this class. Then you can iterate over the solved
forms of this chart using hasNext() and next()
as usual.
Each successful call to next() will return an object
of class List<, i.e. a list of
dominance edge representations. This list can e.g. be passed
to the DomEdge>encode method of OutputCodec or
one of its subclasses.
This class implements a transition system for states consisting of an agenda of subgraphs that must currently be resolved, and a stack of splits that still need to be processed. This algorithm is dramatically faster than a naive algorithm which simply computes the sets of solved forms of a graph by computing the Cartesian product of the sets of solved forms of its subgraphs, but quite a bit more complicated.
- Author:
- Alexander Koller, Michaela Regneri
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetChart()getSolvedForm(int sf) This returns a solved form represented by a List ofDomEdgeobjects.booleanhasNext()convenience methods for implementing Iteratornext()voidremove()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
SolvedFormIterator
-
-
Method Details
-
hasNext
public boolean hasNext()convenience methods for implementing Iterator- Specified by:
hasNextin interfaceIterator<E extends GraphBasedNonterminal>
-
next
- Specified by:
nextin interfaceIterator<E extends GraphBasedNonterminal>
-
getSolvedForm
This returns a solved form represented by a List ofDomEdgeobjects. The form is accessed via its index. Forms with indices exceeding the range ofinthave to be extracted manually by callingnext()as often as necessary.- Parameters:
sf- index of the solved form to extract- Returns:
- the solved form
-
remove
public void remove()- Specified by:
removein interfaceIterator<E extends GraphBasedNonterminal>
-
getChart
-