C# Класс GraphLibrary.Graph

A basic representation of a Graph.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
start BaseVertex

Открытые методы

Метод Описание
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

Описание методов

AcceptsToken() публичный Метод

public AcceptsToken ( String token ) : bool
token String
Результат bool

AddIndividualCharacters() публичный Метод

Switches the character classes to individual characters
public AddIndividualCharacters ( Graph>.Dictionary characterClasses ) : void
characterClasses Graph>.Dictionary
Результат void

CombineGraphs() публичный Метод

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.
Результат void

CombineGraphs() публичный Метод

public CombineGraphs ( Graph that, bool spacewaster ) : void
that Graph
spacewaster bool
Результат void

CreateNewVertex() публичный Метод

Creates a new vertex with a name equal to the current length of the vertex list
public CreateNewVertex ( ) : BaseVertex
Результат BaseVertex

CreateNewVertex() публичный Метод

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.
Результат BaseVertex

CreateNewVertex() публичный Метод

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
Результат BaseVertex

Equals() публичный Метод

public Equals ( object other ) : bool
other object
Результат bool

GetAdjacencyMatrix() публичный Метод

public GetAdjacencyMatrix ( ) : List[][]
Результат List[][]

Graph() публичный Метод

Creates a new Graph with a default start vertex Vertices.
public Graph ( ) : System
Результат System

ReadFromFile() публичный статический Метод

public static ReadFromFile ( String path ) : Graph
path String
Результат Graph

RemoveVertex() публичный Метод

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.
Результат void

SaveToFile() публичный Метод

public SaveToFile ( String path ) : void
path String
Результат void

ToDOT() публичный Метод

Stores this graph in the DOT format to show in graphviz
public ToDOT ( String graphName ) : String
graphName String The name of this graph.
Результат String

WriteTransitionTable() публичный Метод

public WriteTransitionTable ( ) : void
Результат void

findAcceptingParents() публичный Метод

public findAcceptingParents ( char transChar ) : List
transChar char
Результат List

Описание свойств

start публичное свойство

public BaseVertex,GraphLibrary start
Результат BaseVertex