C# Class Smrf.NodeXL.Adapters.UcinetGraphAdapter

Converts a graph to and from a UCINET full matrix DL file.
Use the LoadGraph(String, GraphDirectedness) overload instead of one of the base-class overloads so that the directedness of the UCINET file being loaded can be specified.

Before calling GraphAdapterBase.SaveGraph(IGraph, String), duplicate edges must be merged and the results stored in the value on each vertex.

The only file format supported is the UCINET full matrix DL file, as exported by UCINET version 6.223. The file looks like this:

DL N=11 FORMAT = FULLMATRIX DIAGONAL PRESENT ROW LABELS: "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" COLUMN LABELS: "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" DATA: 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0
Inheritance: GraphAdapterBase, IGraphAdapter
Show file Open project: 2014-sed-team3/term-project Class Usage Examples

Protected Properties

Property Type Description
StreamEncoding Encoding
m_eLoadedGraphDirectedness GraphDirectedness

Public Methods

Method Description
AssertValid ( ) : void
LoadGraph ( String filename, GraphDirectedness fileDirectedness ) : IGraph
UcinetGraphAdapter ( ) : System

Initializes a new instance of the UcinetGraphAdapter class.

Protected Methods

Method Description
AddLoadedVertex ( String sVertexName, IVertexCollection oVertices, IVertex>.Dictionary oVertexDictionary ) : void
GetSupportedDirectedness ( Boolean &supportsDirected, Boolean &supportsUndirected, Boolean &supportsMixed ) : void
LoadGraphCore ( Stream stream ) : IGraph
LoadGraphEdges ( IGraph oGraph, StreamReader oStreamReader, IVertex>.Dictionary oVertexDictionary, Int32 &iLineNumber ) : void
SaveGraphCore ( IGraph graph, Stream stream ) : void

Method Details

AddLoadedVertex() protected method

protected AddLoadedVertex ( String sVertexName, IVertexCollection oVertices, IVertex>.Dictionary oVertexDictionary ) : void
sVertexName String
oVertices IVertexCollection
oVertexDictionary IVertex>.Dictionary
return void

AssertValid() public method

public AssertValid ( ) : void
return void

GetSupportedDirectedness() protected method

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

LoadGraph() public method

public LoadGraph ( String filename, GraphDirectedness fileDirectedness ) : IGraph
filename String
fileDirectedness GraphDirectedness
return IGraph

LoadGraphCore() protected method

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

LoadGraphEdges() protected method

protected LoadGraphEdges ( IGraph oGraph, StreamReader oStreamReader, IVertex>.Dictionary oVertexDictionary, Int32 &iLineNumber ) : void
oGraph IGraph
oStreamReader StreamReader
oVertexDictionary IVertex>.Dictionary
iLineNumber Int32
return void

SaveGraphCore() protected method

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

UcinetGraphAdapter() public method

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

Property Details

StreamEncoding protected static property

protected static Encoding StreamEncoding
return Encoding

m_eLoadedGraphDirectedness protected property

protected GraphDirectedness m_eLoadedGraphDirectedness
return GraphDirectedness