C# Class Smrf.NodeXL.Adapters.GraphAdapterBase

Base class for graph adapters.
This abstract class can serve as a base class for implementations. Its implementations of the public methods provide error checking but defer the actual work to protected abstract methods.
Inheritance: AdapterBase, IGraphAdapter
Show file Open project: 2014-sed-team3/term-project

Public Methods

Method Description
AssertValid ( ) : void
GraphAdapterBase ( ) : System

Initializes a new instance of the GraphAdapterBase class.

LoadGraphFromFile ( String filename ) : IGraph
LoadGraphFromStream ( Stream stream ) : IGraph
LoadGraphFromString ( String theString ) : IGraph
SaveGraph ( IGraph graph, Stream stream ) : void
SaveGraph ( IGraph graph, String filename ) : void
SupportsDirectedness ( GraphDirectedness directedness ) : System.Boolean

Protected Methods

Method Description
CheckGraphDirectedness ( IGraph graph, System.Boolean loading ) : void
GetAttributeNames ( IGraph graph, System.Boolean forVertices ) : String[]
GetSupportedDirectedness ( System.Boolean &supportsDirected, System.Boolean &supportsUndirected, System.Boolean &supportsMixed ) : void
LoadGraphCore ( Stream stream ) : IGraph
OnLoadFormatError ( String completeErrorMessage ) : void
OnLoadFormatError ( String line, Int32 lineNumber, String expectedFormat ) : void
OnLoadFormatError2 ( String line, Int32 lineNumber, String errorDetails ) : void
OnSaveError ( String errorMessage ) : void
SaveGraphCore ( IGraph graph, Stream stream ) : void
TryReadLine ( StreamReader streamReader, String &line, Int32 &lineNumber ) : System.Boolean
VertexCountToString ( Int32 vertices ) : String

Method Details

AssertValid() public method

public AssertValid ( ) : void
return void

CheckGraphDirectedness() protected method

protected CheckGraphDirectedness ( IGraph graph, System.Boolean loading ) : void
graph IGraph
loading System.Boolean
return void

GetAttributeNames() protected method

protected GetAttributeNames ( IGraph graph, System.Boolean forVertices ) : String[]
graph IGraph
forVertices System.Boolean
return String[]

GetSupportedDirectedness() protected abstract method

protected abstract GetSupportedDirectedness ( System.Boolean &supportsDirected, System.Boolean &supportsUndirected, System.Boolean &supportsMixed ) : void
supportsDirected System.Boolean
supportsUndirected System.Boolean
supportsMixed System.Boolean
return void

GraphAdapterBase() public method

Initializes a new instance of the GraphAdapterBase class.
public GraphAdapterBase ( ) : System
return System

LoadGraphCore() protected abstract method

protected abstract LoadGraphCore ( Stream stream ) : IGraph
stream Stream
return IGraph

LoadGraphFromFile() public method

public LoadGraphFromFile ( String filename ) : IGraph
filename String
return IGraph

LoadGraphFromStream() public method

public LoadGraphFromStream ( Stream stream ) : IGraph
stream Stream
return IGraph

LoadGraphFromString() public method

public LoadGraphFromString ( String theString ) : IGraph
theString String
return IGraph

OnLoadFormatError() protected method

protected OnLoadFormatError ( String completeErrorMessage ) : void
completeErrorMessage String
return void

OnLoadFormatError() protected method

protected OnLoadFormatError ( String line, Int32 lineNumber, String expectedFormat ) : void
line String
lineNumber System.Int32
expectedFormat String
return void

OnLoadFormatError2() protected method

protected OnLoadFormatError2 ( String line, Int32 lineNumber, String errorDetails ) : void
line String
lineNumber System.Int32
errorDetails String
return void

OnSaveError() protected method

protected OnSaveError ( String errorMessage ) : void
errorMessage String
return void

SaveGraph() public method

public SaveGraph ( IGraph graph, Stream stream ) : void
graph IGraph
stream Stream
return void

SaveGraph() public method

public SaveGraph ( IGraph graph, String filename ) : void
graph IGraph
filename String
return void

SaveGraphCore() protected abstract method

protected abstract SaveGraphCore ( IGraph graph, Stream stream ) : void
graph IGraph
stream Stream
return void

SupportsDirectedness() public method

public SupportsDirectedness ( GraphDirectedness directedness ) : System.Boolean
directedness GraphDirectedness
return System.Boolean

TryReadLine() protected method

protected TryReadLine ( StreamReader streamReader, String &line, Int32 &lineNumber ) : System.Boolean
streamReader System.IO.StreamReader
line String
lineNumber System.Int32
return System.Boolean

VertexCountToString() protected method

protected VertexCountToString ( Int32 vertices ) : String
vertices System.Int32
return String