C# Class GraphLibrary.Graph

A basic representation of a Graph.
Afficher le fichier Open project: realn0whereman/ScanGen Class Usage Examples

Méthodes publiques

Свойство Type Description
start BaseVertex

Méthodes publiques

Méthode 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 méthode

public AcceptsToken ( String token ) : bool
token String
Résultat bool

AddIndividualCharacters() public méthode

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

CombineGraphs() public méthode

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.
Résultat void

CombineGraphs() public méthode

public CombineGraphs ( Graph that, bool spacewaster ) : void
that Graph
spacewaster bool
Résultat void

CreateNewVertex() public méthode

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

CreateNewVertex() public méthode

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.
Résultat BaseVertex

CreateNewVertex() public méthode

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
Résultat BaseVertex

Equals() public méthode

public Equals ( object other ) : bool
other object
Résultat bool

GetAdjacencyMatrix() public méthode

public GetAdjacencyMatrix ( ) : List[][]
Résultat List[][]

Graph() public méthode

Creates a new Graph with a default start vertex Vertices.
public Graph ( ) : System
Résultat System

ReadFromFile() public static méthode

public static ReadFromFile ( String path ) : Graph
path String
Résultat Graph

RemoveVertex() public méthode

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.
Résultat void

SaveToFile() public méthode

public SaveToFile ( String path ) : void
path String
Résultat void

ToDOT() public méthode

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

WriteTransitionTable() public méthode

public WriteTransitionTable ( ) : void
Résultat void

findAcceptingParents() public méthode

public findAcceptingParents ( char transChar ) : List
transChar char
Résultat List

Property Details

start public_oe property

public BaseVertex,GraphLibrary start
Résultat BaseVertex