|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectSolvedFormIterator
public class SolvedFormIterator
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.
Constructor Summary | |
---|---|
SolvedFormIterator(Chart ch,
DomGraph graph)
|
Method Summary | |
---|---|
Chart |
getChart()
|
List<DomEdge> |
getSolvedForm(int sf)
This returns a solved form represented by a List of DomEdge
objects. |
boolean |
hasNext()
convenience methods for implementing Iterator |
List<DomEdge> |
next()
|
void |
remove()
|
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SolvedFormIterator(Chart ch, DomGraph graph)
Method Detail |
---|
public boolean hasNext()
hasNext
in interface Iterator<List<DomEdge>>
public List<DomEdge> next()
next
in interface Iterator<List<DomEdge>>
public List<DomEdge> getSolvedForm(int sf)
DomEdge
objects. The form is accessed via its index.
Forms with indices exceeding the range of int
have to be
extracted manually by calling next()
as often as necessary.
sf
- index of the solved form to extract
public void remove()
remove
in interface Iterator<List<DomEdge>>
public Chart getChart()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |