Git.framework Reference Library

GITGraph Class Reference

GITGraph Class Reference

Declared in GITGraph.h

Overview

The Graph class manages a graph of nodes and edges for searching and sorting of those nodes.

Tasks

Class Methods

graph

+ (GITGraph *)graph
Return Value

New graph object

Discussion

Creates and returns a new empty graph object.

See Also
Declared In
GITGraph.h

graphWithStartingCommit:

+ (GITGraph *)graphWithStartingCommit:(GITCommit *)commit
Parameters
commit

GITCommit object to populate the graph from

Return Value

New graph object populated with the history of the given commit.

Discussion

Creates and returns a new graph object populated with nodes from the given commit.

The commit history from the commit given is iterated and for each commit found a new node is added to the graph.

See Also
Declared In
GITGraph.h

Instance Methods

init

- (id)init
Return Value

initialised graph object

Discussion

Initialises and returns an empty graph object.

Declared In
GITGraph.h

initWithStartingCommit:

- (id)initWithStartingCommit:(GITCommit *)commit
Parameters
commit

GITCommit object to populate the graph from

Return Value

initialised graph object populated with the history of the given commit.

Discussion

Initialises and returns a graph object populated with nodes from the given commit.

The commit history from the commit given is iterated and for each commit found a new node is added to the graph.

See Also
Declared In
GITGraph.h

hasNode:

- (BOOL)hasNode:(GITGraphNode *)node
Parameters
node

Node to check for

Return Value

Boolean YES if the node is in the graph, NO if not.

Discussion

Checks if the node is present in the receiver.

Declared In
GITGraph.h

addNode:

- (void)addNode:(GITGraphNode *)node
Parameters
node

GITGraphNode to add to the receiver.

Discussion

Adds a node to the receiver.

Declared In
GITGraph.h

removeNode:

- (void)removeNode:(GITGraphNode *)node
Parameters
node

GITGraphNode to remove from the receiver.

Discussion

Removes a node from the receiver.

Declared In
GITGraph.h

addEdgeFromNode:to:

- (void)addEdgeFromNode:(GITGraphNode *)fromNode to:(GITGraphNode *)toNode
Parameters
fromNode

Graph node to create the edge from

toNode

Graph node to create the edge to

Discussion

Add an edge between nodes fromNode and toNode in the receiver.

Declared In
GITGraph.h

removeEdgeFromNode:to:

- (void)removeEdgeFromNode:(GITGraphNode *)fromNode to:(GITGraphNode *)toNode
Parameters
fromNode

Graph node to remove the edge from

toNode

Graph node to remove the edge to

Discussion

Removes an edge between nodes fromNode and toNode in the receiver.

Declared In
GITGraph.h

nodeWithKey:

- (GITGraphNode *)nodeWithKey:(id)key
Parameters
key

Key to identify the node in the receiver.

Return Value

Graph node object identified by the given key, or nil if not found.

Discussion

Returns the node identified by the given key in the receiver.

Declared In
GITGraph.h

nodeCount

- (NSUInteger)nodeCount
Return Value

number of nodes in the receiver

Discussion

Returns the number of nodes in the receiver

Declared In
GITGraph.h

edgeCount

- (NSUInteger)edgeCount
Return Value

number of edges in the receiver

Discussion

Returns the number of edges in the receiver.

Declared In
GITGraph.h

buildWithStartingCommit:

- (void)buildWithStartingCommit:(GITCommit *)commit
Parameters
commit

Commit object to populate the receiver from

Discussion

Populates the receiver with nodes from the history of the given commit

Declared In
GITGraph.h

subtractDescendentNodesFromCommit:

- (void)subtractDescendentNodesFromCommit:(GITCommit *)commit
Parameters
commit

Commit object HEAD to remove from the receiver

Discussion

Removes nodes from the receiver which are in the history of the given commit

Declared In
GITGraph.h

arrayOfNodesSortedByDate

- (NSArray *)arrayOfNodesSortedByDate
Return Value

array of nodes of the receiver sorted by date

Discussion

Returns an array of nodes of the receiver sorted by date.

Declared In
GITGraph.h

arrayOfNodesSortedByTopology

- (NSArray *)arrayOfNodesSortedByTopology
Return Value

array of nodes of the receiver sorted by toplogy

Discussion

Returns an array of nodes of the receiver sorted by toplogy

Declared In
GITGraph.h

arrayOfNodesSortedByTopologyAndDate

- (NSArray *)arrayOfNodesSortedByTopologyAndDate
Return Value

array of nodes of the receiver sorted by toplogy and date

Discussion

Returns an array of nodes of the receiver sorted by toplogy and date

Declared In
GITGraph.h

Last updated: 2011-2-20