- Inherits from:
- Object
- Declared in:
- DGraph.h
Object
|
+---DGraphEdge
Class Description
The graph edge object implements an edge in a graph. This edge can store
another object, so that it can be used as a collection. It can also
store a label and attributes for graphviz visualation.
- Last modified:
- 11-Aug-2008 (DGraph.h)
Instance Variables
- private DGraphNode *_source
- the source node
- private DGraphNode *_target
- the target node
- private DText *_name
- the name (set by DGraph)
- private DText *_label
- the (graphviz) label
- private double _weight
- the weight of the edge (> 0.0)
- private DText *_attributes
- the (graphviz) attributes
- private id _object
- the stored object
- Constructors
- - (DGraphEdge *) init
- Initialise an empty graph edge
- Returns:
- the object
- - (DGraphEdge *) init :(const char *) label :(double) weight :(id) object
- Initialise a graph edge with a label, weight and object
- Parameters:
- label - the label
weight - the weight (> 0.0)
object - the object
- Returns:
- the object
- - (DGraphEdge *) init :(const char *) label :(const char *) attributes :(double) weight :(id) object
- Initialise a graph edge with a label, weight, attributes and object
- Parameters:
- label - the label
attributes - the (graphviz) attributes
weight - the weight (> 0.0)
object - the object
- Returns:
- the object
- Copy related methods
- - deepen
- Deepen a copied edge
- Returns:
- the object
- - shallowCopy
- Do a shallow copy of the graph edge
- Returns:
- the object
- Destructor
- - free
- Free the graph edge (the stored object is freed)
- Returns:
- the object
- - shallowFree
- Free the graph edge (the stored object is NOT freed)
- Returns:
- the object
- Member methods
- - (const char *) attributes
- Return the (graphviz) attributes of the edge
- Returns:
- the attributes (or NULL)
- - (DGraphEdge *) attributes :(const char *) attributes
- Set the (graphviz) attributes for the edge
- Parameters:
- attributes - the attributes
- Returns:
- the edge object
- - (const char *) label
- Return the (graphviz) label of the graph edge
- Returns:
- the label (or NULL)
- - (DGraphEdge *) label :(const char *) label
- Set the (graphviz) label of the graph edge
Return the edge object
- Parameters:
- label - the label
- - (const char *) name
- Return the name of the edge (used by DGraph)
- Returns:
- the name of the node
- - (DGraphEdge *) name :(const char *) name
- Set the name of the edge (used by DGraph)
- Parameters:
- name - the name
- Returns:
- the edge object
- - (id) object
- Return the stored object in the edge
- Returns:
- the (stored) object (or nil)
- - (id) object :(id) object
- Set the object for the edge
- Parameters:
- object - the object
- Returns:
- the previous stored object
- - (double) weight
- Return the weight of the graph edge
- Returns:
- the weight
- - (DGraphEdge *) weight :(double) weight
- Set the weight of the graph edge
Return the edge object
- Parameters:
- weight - the weight (> 0.0)
- main methods
- - (BOOL) connect :(DGraphNode *) source :(DGraphNode *) target
- Connect the source and target nodes by the edge
- Parameters:
- source - the source node (!= nil)
target - the target node (!= nil)
- Returns:
- success
- - (DGraphEdge *) disconnect
- Disconnect the edge from the source and target node
- Returns:
- the edge object
- - (DGraphEdge *) replace :(DGraphNode *) orig :(DGraphNode *) copy
- Replace node with the copied node (used during coping of graph)
- Parameters:
- orig - the original node
copy - the copied node
- Returns:
- the object
- - (DGraphEdge *) reverse
- Reverse the edge
- Returns:
- the edge object
- - (DGraphNode *) source
- Return the source node
- Returns:
- the source node
- - (DGraphNode *) target
- Return the target node
- Returns:
- the target node (or nil)
generated 06-Sep-2008 by ObjcDoc 3.0.0