public class GraphSpec extends DataStructureSpec
Constructor and Description |
---|
GraphSpec(org.w3c.dom.Element elem)
Construct a graph specification from an XML element
|
GraphSpec(java.lang.String specName)
Construct an empty graph specification with the given name
|
Modifier and Type | Method and Description |
---|---|
void |
addEdgeTemplate(java.lang.String templateName)
Add the template by name to the set of templates used for edges in this
graph specification
|
void |
addNodeTemplate(java.lang.String templateName)
Add the template by name to the set of templates used for nodes in this
graph specification
|
java.lang.String |
getDestinationField()
Get the field used to indicate the destination node for an edge
|
java.util.HashSet<java.lang.String> |
getEdgeTemplateNames()
Get the names of the edge templates for this graph spec.
|
java.util.Set<DataTemplate> |
getEdgeTemplates()
Get the edge templates for this graph specification
|
java.lang.String |
getName()
Get the name for the particular data structure
|
java.lang.String |
getOriginField()
Get the field used to indicate the origin node for an edge
|
java.util.HashSet<java.lang.String> |
getTemplateNames()
Get the names of the templates identified for this GraphSpec.
|
boolean |
isDirected()
Determine whether the graph should be a directed graph or an undirected
graph
|
void |
loadFromXml(org.w3c.dom.Element elem)
Load the Graph Specification from an XML element.
|
void |
storeTemplates(java.util.HashMap<java.lang.String,DataTemplate> dataTemplates)
This method identifies the templates which this particular data
structure needs, and stores them.
|
org.w3c.dom.Element |
toXml(org.w3c.dom.Document doc)
Convert this specification into XML format.
|
getTemplates
public GraphSpec(org.w3c.dom.Element elem)
elem
- the element containing the graph specificationpublic GraphSpec(java.lang.String specName)
specName
- the name of the graph specificationpublic void addEdgeTemplate(java.lang.String templateName)
templateName
- the template namepublic void addNodeTemplate(java.lang.String templateName)
templateName
- the template namepublic java.lang.String getDestinationField()
public java.util.HashSet<java.lang.String> getEdgeTemplateNames()
public java.util.Set<DataTemplate> getEdgeTemplates()
public java.lang.String getName()
getName
in class DataStructureSpec
public java.lang.String getOriginField()
public java.util.HashSet<java.lang.String> getTemplateNames()
getEdgeTemplateNames()
.getTemplateNames
in class DataStructureSpec
public boolean isDirected()
public void loadFromXml(org.w3c.dom.Element elem)
nodeClass
, and may be a
space-separated sequence of template names. The edge classes similarly
are specified by the attribute edgeClass
. The
directed
attribute specifies whether the graph is directed
or not; if not set, the default is false, meaning an undirected graph.elem
- the element to parsepublic void storeTemplates(java.util.HashMap<java.lang.String,DataTemplate> dataTemplates)
storeTemplates
in class DataStructureSpec
dataTemplates
- a map of the data templates, with the template
names as the keyspublic org.w3c.dom.Element toXml(org.w3c.dom.Document doc)
doc
- the document to use to create the elements