C# Class GraphLibrary.Graph

A basic representation of a Graph.
Mostra file Open project: realn0whereman/ScanGen Class Usage Examples

Public Properties

Property Type Description
start BaseVertex

Public Methods

Method Description
AcceptsToken ( String token ) : bool
AddIndividualCharacters ( Graph>.Dictionary characterClasses ) : void

Switches the character classes to individual characters

CombineGraphs ( Graph that ) : void

Combines two graphs. Uses this as the base and adds the passed one to the end.

CombineGraphs ( Graph that, bool spacewaster ) : void
CreateNewVertex ( ) : BaseVertex

Creates a new vertex with a name equal to the current length of the vertex list

CreateNewVertex ( bool accepting ) : BaseVertex

Creates a new vertex with a name equal to the current length of the vertex list

CreateNewVertex ( string name, bool accepting ) : BaseVertex

Creates and returns a new BaseVertex with the given name and adds it to the graph

Equals ( object other ) : bool
GetAdjacencyMatrix ( ) : List[][]
Graph ( ) : System

Creates a new Graph with a default start vertex Vertices.

ReadFromFile ( String path ) : Graph
RemoveVertex ( BaseVertex toRemove ) : void

Removes the given Vertex from the graph; also removes all edges which use this vertex.

SaveToFile ( String path ) : void
ToDOT ( String graphName ) : String

Stores this graph in the DOT format to show in graphviz

WriteTransitionTable ( ) : void
findAcceptingParents ( char transChar ) : List

Method Details

AcceptsToken() public method

public AcceptsToken ( String token ) : bool
token String
return bool

AddIndividualCharacters() public method

Switches the character classes to individual characters
public AddIndividualCharacters ( Graph>.Dictionary characterClasses ) : void
characterClasses Graph>.Dictionary
return void

CombineGraphs() public method

Combines two graphs. Uses this as the base and adds the passed one to the end.
public CombineGraphs ( Graph that ) : void
that Graph Graph -> The graph to tack onto this one.
return void

CombineGraphs() public method

public CombineGraphs ( Graph that, bool spacewaster ) : void
that Graph
spacewaster bool
return void

CreateNewVertex() public method

Creates a new vertex with a name equal to the current length of the vertex list
public CreateNewVertex ( ) : BaseVertex
return BaseVertex

CreateNewVertex() public method

Creates a new vertex with a name equal to the current length of the vertex list
public CreateNewVertex ( bool accepting ) : BaseVertex
accepting bool Whether the vertex is an accepting state or not.
return BaseVertex

CreateNewVertex() public method

Creates and returns a new BaseVertex with the given name and adds it to the graph
public CreateNewVertex ( string name, bool accepting ) : BaseVertex
name string The name of the vertex to be added. The name must be unique.
accepting bool
return BaseVertex

Equals() public method

public Equals ( object other ) : bool
other object
return bool

GetAdjacencyMatrix() public method

public GetAdjacencyMatrix ( ) : List[][]
return List[][]

Graph() public method

Creates a new Graph with a default start vertex Vertices.
public Graph ( ) : System
return System

ReadFromFile() public static method

public static ReadFromFile ( String path ) : Graph
path String
return Graph

RemoveVertex() public method

Removes the given Vertex from the graph; also removes all edges which use this vertex.
public RemoveVertex ( BaseVertex toRemove ) : void
toRemove BaseVertex The Vertex which will be completely removed from the graph.
return void

SaveToFile() public method

public SaveToFile ( String path ) : void
path String
return void

ToDOT() public method

Stores this graph in the DOT format to show in graphviz
public ToDOT ( String graphName ) : String
graphName String The name of this graph.
return String

WriteTransitionTable() public method

public WriteTransitionTable ( ) : void
return void

findAcceptingParents() public method

public findAcceptingParents ( char transChar ) : List
transChar char
return List

Property Details

start public_oe property

public BaseVertex,GraphLibrary start
return BaseVertex