com.sun.tools.xjc.reader.gbind
public abstract class Element extends Expression implements ElementSet
Since this package is about a regular expression over element declarations, this represents an XML element declaration (hence the name.) Element needs to be interned, meaning one Element per one tag name.
Implements ElementSet to represent a self.
| Field Summary | |
|---|---|
| Set<Element> | backEdges |
| Set<Element> | foreEdges
Once we build a graph from Expression,
we represent an edge e1 -> e2 by {@code e1.foreEdges.contains(e2)}
and {@code e2.backEdges.contains(e1)}. |
| Element | prevPostOrder
Previous element in the DFS post-order traveral
of the element graph.
|
| Constructor Summary | |
|---|---|
| protected | Element() |
| Method Summary | |
|---|---|
| void | addNext(Element element) |
| Element | assignDfsPostOrder(Element prev)
Traverses the Element graph with DFS
and set prevPostOrder.
|
| void | buildDAG(ElementSet incoming) |
| void | buildStronglyConnectedComponents(List<ConnectedComponent> ccs)
Builds a set of strongly connected components and puts them
all into the given set. |
| boolean | checkCutSet(ConnectedComponent cc, Set<Element> visited)
Checks if the given ConnectedComponent forms a cut-set
of a graph.
|
| boolean | contains(ElementSet rhs) |
| boolean | hasSelfLoop() |
| boolean | isNullable() |
| boolean | isSink() |
| boolean | isSource()
True if this Element is SourceNode. |
| Iterator<Element> | iterator()
Just to satisfy the ElementSet contract.
|
| ElementSet | lastSet() |
We use {@code prevPostOrder==null} as a check if the element is visted in DFS, so this chain terminates by a self-reference, not by having null. Set in assignDfsPostOrder
Parameters: visited Used to keep track of visited nodes.
Returns: true if it is indeed a cut-set. false if not.
Deprecated: if you statically call this method, there's something wrong.
Just to satisfy the ElementSet contract.