yext.graphml.writer
Class YGraphElementProvider

java.lang.Object
  extended byyext.graphml.writer.YGraphElementProvider
All Implemented Interfaces:
GraphElementProvider
Direct Known Subclasses:
DotnetGraphElementProvider, YHierarchyGraphElementProvider

public class YGraphElementProvider
extends Object
implements GraphElementProvider

Implementation of the GraphElementProvider interface for yFiles.

Note: Once an instance of this class is created, the graph must not change until the instance is no longer used.

See Also:
GraphElementProvider

Field Summary
protected  boolean defaultDirected
           
protected  DataProvider directionDP
           
protected  Graph graph
           
protected static Iterator nullIterator
           
 
Constructor Summary
YGraphElementProvider(Graph graph)
          Creates a new instance for a given graph.
 
Method Summary
 int getEdgeCount()
          The number of edges in the graph.
 Iterator getEdgeObjects()
          Return an iterator over all edges that are contained in the current graph object
 Iterator getEndpointObjects(Object hyperedge)
          Return an iterator over all endpoints that belong to the given hyperedge
 Object getGraphObject()
          The enclosing graph.
 int getHyperEdgeCount()
          No hyperedges are defined in an instance of Graph.
 Iterator getHyperEdgeObjects()
          Return an iterator over all hyperedges that are contained in the current graph object
 int getNodeCount()
          The number of nodes in the graph.
 Iterator getNodeObjects()
          Return an iterator over all nodes that are contained in the current graph object
 GraphElementProvider getNodeSubgraph(Object node)
          Clustered/nested graphs are not supported yet.
 Iterator getPortObjects(Object node)
          Return an iterator over all ports that belong to the given node
 Object getSourceNode(Object edge)
          Returns the source node of an edge.
 Object getSourcePort(Object edge)
          Returns the source port of an edge.
 Object getTargetNode(Object edge)
          Returns the target node of an edge.
 Object getTargetPort(Object edge)
          Returns the target port of an edge.
 boolean isDefaultDirected()
          In yFiles all graph are directed by default.
 boolean isDirected(Object edge)
          Returns whether an edge is directed.
protected  void setDefaultDirected(boolean value)
           
protected  void setEdgeDirection(DataProvider dp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

graph

protected Graph graph

directionDP

protected DataProvider directionDP

defaultDirected

protected boolean defaultDirected

nullIterator

protected static final Iterator nullIterator
Constructor Detail

YGraphElementProvider

public YGraphElementProvider(Graph graph)
Creates a new instance for a given graph.

Parameters:
graph - the graph which stores the data for this instance.
Method Detail

setEdgeDirection

protected void setEdgeDirection(DataProvider dp)

setDefaultDirected

protected void setDefaultDirected(boolean value)

isDefaultDirected

public boolean isDefaultDirected()
In yFiles all graph are directed by default.

Specified by:
isDefaultDirected in interface GraphElementProvider
Returns:
true.

getGraphObject

public Object getGraphObject()
Description copied from interface: GraphElementProvider
The enclosing graph.

Specified by:
getGraphObject in interface GraphElementProvider
Returns:
the current graph object

getNodeObjects

public Iterator getNodeObjects()
Description copied from interface: GraphElementProvider
Return an iterator over all nodes that are contained in the current graph object

Specified by:
getNodeObjects in interface GraphElementProvider
Returns:
an iterator over all nodes that are contained in the current graph object

getEdgeObjects

public Iterator getEdgeObjects()
Description copied from interface: GraphElementProvider
Return an iterator over all edges that are contained in the current graph object

Specified by:
getEdgeObjects in interface GraphElementProvider
Returns:
an iterator over all edges that are contained in the current graph object

getNodeCount

public int getNodeCount()
Description copied from interface: GraphElementProvider
The number of nodes in the graph.

Specified by:
getNodeCount in interface GraphElementProvider
Returns:
the number of nodes in the graph.

getEdgeCount

public int getEdgeCount()
Description copied from interface: GraphElementProvider
The number of edges in the graph.

Specified by:
getEdgeCount in interface GraphElementProvider
Returns:
the number of edges in the graph.

getSourceNode

public Object getSourceNode(Object edge)
Description copied from interface: GraphElementProvider
Returns the source node of an edge.

Specified by:
getSourceNode in interface GraphElementProvider
Returns:
the source node of an edge

getTargetNode

public Object getTargetNode(Object edge)
Description copied from interface: GraphElementProvider
Returns the target node of an edge.

Specified by:
getTargetNode in interface GraphElementProvider
Returns:
the target node of an edge

getSourcePort

public Object getSourcePort(Object edge)
Description copied from interface: GraphElementProvider
Returns the source port of an edge.

Specified by:
getSourcePort in interface GraphElementProvider
Returns:
the source port of an edge

getTargetPort

public Object getTargetPort(Object edge)
Description copied from interface: GraphElementProvider
Returns the target port of an edge.

Specified by:
getTargetPort in interface GraphElementProvider
Returns:
the target port of an edge

isDirected

public boolean isDirected(Object edge)
Description copied from interface: GraphElementProvider
Returns whether an edge is directed.

Specified by:
isDirected in interface GraphElementProvider
Returns:
true iff the edge is directed

getEndpointObjects

public Iterator getEndpointObjects(Object hyperedge)
Description copied from interface: GraphElementProvider
Return an iterator over all endpoints that belong to the given hyperedge

Specified by:
getEndpointObjects in interface GraphElementProvider
Returns:
an iterator over all endpoints that belong to the given hyperedge

getHyperEdgeObjects

public Iterator getHyperEdgeObjects()
Description copied from interface: GraphElementProvider
Return an iterator over all hyperedges that are contained in the current graph object

Specified by:
getHyperEdgeObjects in interface GraphElementProvider
Returns:
an iterator over all hyperedges that are contained in the current graph object

getPortObjects

public Iterator getPortObjects(Object node)
Description copied from interface: GraphElementProvider
Return an iterator over all ports that belong to the given node

Specified by:
getPortObjects in interface GraphElementProvider
Returns:
an iterator over all ports that belong to the given node

getNodeSubgraph

public GraphElementProvider getNodeSubgraph(Object node)
Clustered/nested graphs are not supported yet.

Specified by:
getNodeSubgraph in interface GraphElementProvider
Returns:
null.

getHyperEdgeCount

public int getHyperEdgeCount()
No hyperedges are defined in an instance of Graph.

Specified by:
getHyperEdgeCount in interface GraphElementProvider
Returns:
0.


Copyright ©2000-2008, yWorks GmbH. All rights reserved.