C# Class VelocityGraph.VertexType

Inheritance: OptimizedPersistable
Mostra file Open project: VelocityDB/VelocityDB Class Usage Examples

Private Properties

Property Type Description
AddToResult void
NewHeadToTailEdge void
NewTailToHeadEdge void
RemoveHeadToTailEdge void
RemoveTailToHeadEdge void
Traverse HashSet>.Dictionary
Traverse HashSet>.Dictionary
VertexType System

Public Methods

Method Description
CountVertices ( ) : long

Count of vertcies

FindProperty ( string name ) : PropertyType

Gets the associated PropertyType given a propert type name or null if such property type does't exist.

GetEdges ( EdgeType etype, Direction dir ) : IEnumerable

Enumerates edges connected wih this vertex type

GetEdges ( EdgeType edgeType, Vertex vertex1, Direction dir, Vertex vertex2 = null ) : IEnumerable

Get all edges found between two vertices

GetEdges ( Vertex vertex1, Direction dir ) : IEnumerable

Get all edges found from a given Vertex

GetNumberOfEdges ( EdgeType etype, Direction dir ) : long

Get the number of edges of a certain type that can be found and an edge direction

GetNumberOfEdges ( EdgeType etype, Int32 vertexId, Direction dir ) : long

Get the number of edges of a certain type that can be found associated with a vertex id and an edge direction

GetNumberOfEdges ( EdgeType edgeType, Int32 vertexId, Int32 vertexId2, Direction dir ) : long

Get the number of edges of a certain type that can be found associated with a vertex id, another vertex id at other end and an edge direction

GetPropertyKeys ( ) : IEnumerable

Return all the keys associated with the vertex type.

GetPropertyTypes ( ) : IEnumerable

Return all the property types associated with vertex type.

GetPropertyValue ( Int32 vertexId, PropertyType propertyType ) : object

Get the property value for a Vertex

GetTopNumberOfEdges ( EdgeType etype, int howMany, Direction dir ) : Vertex[]

Get the top vertices with the most number of edges of the given edge type

GetVertex ( Int32 vertexId, bool polymorphic = false, bool errorIfNotFound = true ) : Vertex

Instantiates a Vertex if it exist

GetVerticeIds ( ) : IEnumerable

Get existing Vertex ids for this type

GetVertices ( EdgeType etype, Vertex vertex1, Direction dir ) : IEnumerable

Get an enumeration of existing vertices of this type found by following an edge type

GetVertices ( bool polymorphic = false ) : IEnumerable

Enumerates all vertices for the given type

NewProperty ( string name, DataType dt, PropertyKind kind ) : PropertyType

Creates a new Property.

NewVertex ( Int32 vId ) : Vertex

Creates a new Vertex

Remove ( ) : void

Removes this VertexType from a graph. An exception is thrown if the VertexType is in use.

RemoveVertex ( Vertex vertex ) : void

Removes a vertex from this type and graph

SetPropertyValue ( Int32 vertexId, PropertyType propertyType, IComparable v ) : void

Sets a property value

ToString ( ) : string
Unpersist ( SessionBase session ) : void

Protected Methods

Method Description
edgeVertexId ( System.Edge edge, Int32 vertexId ) : System.UInt64

Gets a combined Edge id and Vertex id

Private Methods

Method Description
AddToResult ( Dictionary result, Vertex key, System.Edge value ) : void
NewHeadToTailEdge ( EdgeType edgeType, System.Edge edge, Vertex tail, Vertex head, SessionBase session ) : void
NewTailToHeadEdge ( EdgeType edgeType, System.Edge edge, Vertex tail, Vertex head, SessionBase session ) : void
RemoveHeadToTailEdge ( System.Edge edge ) : void
RemoveTailToHeadEdge ( System.Edge edge ) : void
Traverse ( Vertex vertex1, Direction dir, ISet edgeTypesToTraverse = null ) : HashSet>.Dictionary
Traverse ( Vertex vertex1, EdgeType etype, Direction dir ) : HashSet>.Dictionary

Selects all neighbor Vertices from or to this vertex and for the given edge type.

VertexType ( Int32 aTypeId, string aTypeName, VertexType baseType, Graph graph ) : System

Method Details

CountVertices() public method

Count of vertcies
public CountVertices ( ) : long
return long

FindProperty() public method

Gets the associated PropertyType given a propert type name or null if such property type does't exist.
public FindProperty ( string name ) : PropertyType
name string A property type name
return PropertyType

GetEdges() public method

Enumerates edges connected wih this vertex type
public GetEdges ( EdgeType etype, Direction dir ) : IEnumerable
etype EdgeType A type of edge type to look for
dir Direction Direction of edge
return IEnumerable

GetEdges() public method

Get all edges found between two vertices
public GetEdges ( EdgeType edgeType, Vertex vertex1, Direction dir, Vertex vertex2 = null ) : IEnumerable
edgeType EdgeType Restrict to this type of edge
vertex1 Vertex Start
dir Direction Follow edges in this direction
vertex2 Vertex End
return IEnumerable

GetEdges() public method

Get all edges found from a given Vertex
public GetEdges ( Vertex vertex1, Direction dir ) : IEnumerable
vertex1 Vertex A id
dir Direction follow edges in this direction
return IEnumerable

GetNumberOfEdges() public method

Get the number of edges of a certain type that can be found and an edge direction
public GetNumberOfEdges ( EdgeType etype, Direction dir ) : long
etype EdgeType Use this type of edge
dir Direction Edge direction to follow
return long

GetNumberOfEdges() public method

Get the number of edges of a certain type that can be found associated with a vertex id and an edge direction
public GetNumberOfEdges ( EdgeType etype, Int32 vertexId, Direction dir ) : long
etype EdgeType Type of edges to look for
vertexId System.Int32 Id of a
dir Direction Edge direction to use
return long

GetNumberOfEdges() public method

Get the number of edges of a certain type that can be found associated with a vertex id, another vertex id at other end and an edge direction
public GetNumberOfEdges ( EdgeType edgeType, Int32 vertexId, Int32 vertexId2, Direction dir ) : long
edgeType EdgeType
vertexId System.Int32 Id of a
vertexId2 System.Int32 Id of a
dir Direction Edge direction to use
return long

GetPropertyKeys() public method

Return all the keys associated with the vertex type.
public GetPropertyKeys ( ) : IEnumerable
return IEnumerable

GetPropertyTypes() public method

Return all the property types associated with vertex type.
public GetPropertyTypes ( ) : IEnumerable
return IEnumerable

GetPropertyValue() public method

Get the property value for a Vertex
public GetPropertyValue ( Int32 vertexId, PropertyType propertyType ) : object
vertexId System.Int32 Id of
propertyType PropertyType Type of property
return object

GetTopNumberOfEdges() public method

Get the top vertices with the most number of edges of the given edge type
public GetTopNumberOfEdges ( EdgeType etype, int howMany, Direction dir ) : Vertex[]
etype EdgeType The edge type to look for
howMany int How many top ones to collect
dir Direction What end of edges to look at
return Vertex[]

GetVertex() public method

Instantiates a Vertex if it exist
public GetVertex ( Int32 vertexId, bool polymorphic = false, bool errorIfNotFound = true ) : Vertex
vertexId System.Int32 id of Vertex we are looking for
polymorphic bool If true and id isn't found in this VertexType continue search into sub types
errorIfNotFound bool Indicate what to do if Vertex does not exist
return Vertex

GetVerticeIds() public method

Get existing Vertex ids for this type
public GetVerticeIds ( ) : IEnumerable
return IEnumerable

GetVertices() public method

Get an enumeration of existing vertices of this type found by following an edge type
public GetVertices ( EdgeType etype, Vertex vertex1, Direction dir ) : IEnumerable
etype EdgeType Edge type to follow
vertex1 Vertex Vertex to start from
dir Direction Edge direction to follow
return IEnumerable

GetVertices() public method

Enumerates all vertices for the given type
public GetVertices ( bool polymorphic = false ) : IEnumerable
polymorphic bool If true, also include all vertices of sub types of this VertexType
return IEnumerable

NewProperty() public method

Creates a new Property.
public NewProperty ( string name, DataType dt, PropertyKind kind ) : PropertyType
name string Unique name for the new Property.
dt DataType Data type for the new Property.
kind PropertyKind Property kind.
return PropertyType

NewVertex() public method

Creates a new Vertex
public NewVertex ( Int32 vId ) : Vertex
vId System.Int32 Optionally provide the Vertex id to use.
return Vertex

Remove() public method

Removes this VertexType from a graph. An exception is thrown if the VertexType is in use.
public Remove ( ) : void
return void

RemoveVertex() public method

Removes a vertex from this type and graph
public RemoveVertex ( Vertex vertex ) : void
vertex Vertex The vertex to remove
return void

SetPropertyValue() public method

Sets a property value
public SetPropertyValue ( Int32 vertexId, PropertyType propertyType, IComparable v ) : void
vertexId System.Int32 Id of for which to set property value
propertyType PropertyType The type of property to set
v IComparable the value to set the property to
return void

ToString() public method

public ToString ( ) : string
return string

Unpersist() public method

public Unpersist ( SessionBase session ) : void
session SessionBase
return void

edgeVertexId() protected method

Gets a combined Edge id and Vertex id
protected edgeVertexId ( System.Edge edge, Int32 vertexId ) : System.UInt64
edge System.Edge Get edge id from this edge
vertexId System.Int32 A id
return System.UInt64