- Inherits from:
- Object
- Declared in:
- DGraph.h
Object
|
+---DGraphNode
Class Description
The graph node object stores an object in a node in a graph.
- Last modified:
- 10-Jul-2005 (DGraph.h)
Instance Variables
- private DList *_ingoing
- the ingoing edges
- private DList *_outgoing
- the outgoing edges
- private DText *_name
- the name (set by DGraph)
- private DText *_label
- the (graphviz) label
- private DText *_attributes
- the (graphviz) attributes
- private id _object
- the stored object
- private DGraphNode *_prev
- the previous node (during shortest path)
- private double _sum
- the weight sum (during shortest path)
- Constructors
- - (DGraphNode *) init
- Initialise an empty graph node
- Returns:
- the object
- - (DGraphNode *) init :(const char *) label :(id) object
- Initialise a graph node with a label and object
- Parameters:
- label - the label for the node
object - the object
- Returns:
- the object
- - (DGraphNode *) init :(const char *) label :(const char *) attributes :(id) object
- Initialise a graph node with a label, attributes and object
- Parameters:
- label - the label for the node
attributes - the (graphviz) attributes for the node
object - the object
- Returns:
- the object
- Copy related methods
- - deepen
- Deepen a copy of the graph node (not implemented)
- Returns:
- the object
- Destructor
- - free
- Free the graph node (the stored object is freed, the stored
edges are NOT freed)
- Returns:
- the object
- - shallowFree
- Free the graph node (the stored edges and object are NOT freed)
- Returns:
- the object
- Member methods
- - (const char *) attributes
- Return the (graphviz) attributes of the node
- Returns:
- the attributes (or NULL)
- - (DGraphNode *) attributes :(const char *) attributes
- Set the (graphviz) attributes for the node
- Parameters:
- attributes - the attributes (or NULL)
- Returns:
- the node object
- - (const char *) label
- Return the label of the graph node
- Returns:
- the label (or NULL)
- - (DGraphNode *) label :(const char *) label
- Set the label of the graph node
Return the node object
- Parameters:
- label - the label (or NULL)
- - (const char *) name
- Return the name of the graph node (used by DGraph)
- Returns:
- the name of the node
- - (DGraphNode *) name :(const char *) name
- Set the name of the graph node (used by DGraph)
- Parameters:
- name - the name
- Returns:
- the node object
- - (id) object
- Return the stored object in the node
- Returns:
- the (stored) object (or nil)
- - (id) object :(id) object
- Set the object for the node
- Parameters:
- object - the object (or nil)
- Returns:
- the previous stored object
- Path methods (used during shortest path determination)
- - (DGraphNode *) path
- Reset the path
- Returns:
- the node object
- - (DGraphNode *) path :(DGraphNode *) prev :(double) sum
- Set the path
- Parameters:
- prev - the previous node in the path
sum - the sum of weights in the path
- Returns:
- the node object
- - (DGraphNode *) prev
- Return the previous node in the path
- Returns:
- the previous node (or nil)
- - (double) sum
- Return the sum of weights in the path
- Returns:
- the sum
- Edge methods
- - (DGraphNode *) addIngoingEdge :(DGraphEdge *) edge
- Add an ingoing edge
- Parameters:
- edge - the edge
- Returns:
- the node object
- - (DGraphNode *) addOutgoingEdge :(DGraphEdge *) edge
- Add an outgoing edge
- Parameters:
- edge - the edge
- Returns:
- the node object
- - (unsigned long) degree
- Return the degree of the node
- Returns:
- the number of ingoing and outgoing edges
- - (unsigned long) ingoingDegree
- Return the ingoing degree of the node
- Returns:
- the number of ingoing edges
- - (unsigned long) outgoingDegree
- Return the outgoing degree of the node
- Returns:
- the number of output edges
- - (BOOL) removeIngoingEdge :(DGraphEdge *) edge
- Remove an ingoing edge
- Parameters:
- edge - the edge
- Returns:
- success
- - (BOOL) removeOutgoingEdge :(DGraphEdge *) edge
- Remove an outgoing edge
- Parameters:
- edge - the edge
- Returns:
- success
- Edge iterators
- - (DListIterator *) ingoingEdges
- Return the ingoing edge iterator
- Returns:
- a (new) iterator on the ingoing edges
- - (DListIterator *) outgoingEdges
- Return the outgoing edge iterator
- Returns:
- a (new) list iterator on the outgoing edges
generated 08-Jan-2006 by ObjcDoc 3.0.0