|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.brics.xmlgraph.XMLGraph
public class XMLGraph
XML graph (also known as a Summary Graph).
Constructor Summary | |
---|---|
XMLGraph()
Constructs a new empty XML graph. |
Method Summary | ||
---|---|---|
void |
addClosedAttributeGap(String g)
Adds a gap name to the set of maybe closed attribute gaps. |
|
void |
addClosedTemplateGap(String g)
Adds a gap name to the set of maybe closed template gaps. |
|
void |
addNode(Node n)
Adds a node. |
|
void |
addOpenAttributeGap(String g)
Adds a gap name to the set of maybe open attribute gaps. |
|
void |
addOpenTemplateGap(String g)
Adds a gap name to the set of maybe open template gaps. |
|
void |
addRoot(Node n)
Adds a node as root. |
|
boolean |
check(PrintStream err)
Checks that this XML graph is well-defined using a WelldefinedChecker . |
|
XMLGraph |
clone()
Clones this XML graph. |
|
Set<Integer> |
extendWith(XMLGraph xg)
Extends this XML graph with a copy of the given one. |
|
Set<String> |
getClosedAttributeGaps()
Returns names of all maybe closed attribute gaps. |
|
Set<String> |
getClosedTemplateGaps()
Returns names of all maybe closed template gaps. |
|
Map<String,String> |
getGapTypeMap()
Returns map from gap names to schema types. |
|
Node |
getNode(int i)
Returns node of the given index |
|
ArrayList<Node> |
getNodes()
Returns all nodes in this XML graph. |
|
Set<String> |
getOpenAttributeGaps()
Returns names of all maybe open attribute gaps. |
|
Set<String> |
getOpenTemplateGaps()
Returns names of all maybe open template gaps. |
|
Set<Integer> |
getRoots()
Returns all roots. |
|
boolean |
isUnknown()
Returns true if this XML graph represents unknown XML data. |
|
boolean |
merge(XMLGraph xg)
Merges the given XML graph into this one, resulting in the least upper bound. |
|
|
processNodes(NodeProcessor<T> v)
Processes all nodes using the given pattern processor. |
|
|
processReachableNodes(NodeProcessor<T> v)
Processes all reachable nodes using the given pattern processor. |
|
|
processRoots(NodeProcessor<T> v)
Processes all roots using the given processor |
|
void |
removeClosedAttributeGap(String g)
Removes a gap name from the set of maybe closed attribute gaps. |
|
void |
removeClosedTemplateGap(String g)
Removes a gap name from the set of maybe closed template gaps. |
|
void |
removeOpenAttributeGap(String g)
Removes a gap name from the set of maybe open attribute gaps. |
|
void |
removeOpenTemplateGap(String g)
Removes a gap name from the set of maybe open template gaps. |
|
void |
setNode(int index,
Node n)
Replaces a node. |
|
void |
setRoots(Set<Integer> roots)
Sets the roots to the given set. |
|
void |
setUnknown()
Marks this XML graph as representing unknown XML data. |
|
void |
sharpen()
Sharpens this XML graph by removing unreachable edges, element/attribute names, text, and gap presence. |
|
void |
simplify()
Simplifies this XML graph by bypassing single-content choice/sequence/interleave nodes. |
|
void |
useFragment(XMLGraphFragment f)
Sets the roots, gap types, and gap presence according to the given fragment. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XMLGraph()
Method Detail |
---|
public void addClosedAttributeGap(String g)
g
- gap namepublic void addClosedTemplateGap(String g)
g
- gap namepublic void addNode(Node n)
n
- node (not already in the graph)public void addOpenAttributeGap(String g)
g
- gap namepublic void addOpenTemplateGap(String g)
g
- gap namepublic void addRoot(Node n)
n
- node (not already added as a root), ignored if nullpublic boolean check(PrintStream err)
WelldefinedChecker
.
err
- print stream for error messages, null if none
public XMLGraph clone()
clone
in class Object
public Set<Integer> extendWith(XMLGraph xg)
xg
- an XML graph
public Set<String> getClosedAttributeGaps()
public Set<String> getClosedTemplateGaps()
public Map<String,String> getGapTypeMap()
public Node getNode(int i)
i
- node index
public ArrayList<Node> getNodes()
public Set<String> getOpenAttributeGaps()
public Set<String> getOpenTemplateGaps()
public Set<Integer> getRoots()
public boolean isUnknown()
public boolean merge(XMLGraph xg) throws IllegalArgumentException
xg
- XML graph
IllegalArgumentException
- if the XML graphs are incompatiblepublic <T> void processNodes(NodeProcessor<T> v)
v
- node processorpublic <T> void processReachableNodes(NodeProcessor<T> v)
v
- node processorpublic <T> void processRoots(NodeProcessor<T> v)
v
- node processorpublic void removeClosedAttributeGap(String g)
g
- gap namepublic void removeClosedTemplateGap(String g)
g
- gap namepublic void removeOpenAttributeGap(String g)
g
- gap namepublic void removeOpenTemplateGap(String g)
g
- gap namepublic void setNode(int index, Node n)
index
- indexn
- new nodepublic void setRoots(Set<Integer> roots)
roots
- set of root indicespublic void setUnknown()
public void sharpen()
public void simplify()
public void useFragment(XMLGraphFragment f)
f
- XML graph fragment (null represents an empty fragment)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |