Skip to content

Commit 07854cc

Browse files
committed
Make AbstractVertexOrEdgeDataType a union type instead of abstract type.
1 parent c418c41 commit 07854cc

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/abstractedgeorvertexdatagraph.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ using Dictionaries: Dictionaries, Indices, isinsertable, set!
22
using Graphs: edges, edgetype, has_edge, has_vertex, rem_edge!, rem_vertex!, vertices
33
using NamedGraphs: NamedGraphs, Vertices, similar_graph, subgraph_edges, to_graph_index
44

5-
abstract type AbstractVertexOrEdgeDataGraph{T, V} <: AbstractDataGraph{V, T, T} end
5+
abstract type AbstractVertexDataGraph{T, V} <: AbstractDataGraph{V, T, Nothing} end
6+
abstract type AbstractEdgeDataGraph{T, V} <: AbstractDataGraph{V, Nothing, T} end
7+
8+
const AbstractVertexOrEdgeDataGraph{T, V} =
9+
Union{AbstractVertexDataGraph{T, V}, AbstractEdgeDataGraph{T, V}}
610

711
Graphs.edgetype(graph::AbstractVertexOrEdgeDataGraph) = edgetype(typeof(graph))
812

@@ -69,8 +73,6 @@ end
6973

7074
# ================================== vertex data graph =================================== #
7175

72-
abstract type AbstractVertexDataGraph{T, V} <: AbstractVertexOrEdgeDataGraph{T, V} end
73-
7476
Base.keytype(::Type{<:AbstractVertexDataGraph{T, V}}) where {T, V} = V
7577

7678
is_edge_assigned(::AbstractVertexDataGraph, _edge) = false
@@ -167,8 +169,6 @@ end
167169

168170
# =================================== edge data graph ==================================== #
169171

170-
abstract type AbstractEdgeDataGraph{T, V} <: AbstractVertexOrEdgeDataGraph{T, V} end
171-
172172
Base.keytype(::Type{<:AbstractEdgeDataGraph{T, V}}) where {T, V} = NamedEdge{V}
173173

174174
is_vertex_assigned(::AbstractEdgeDataGraph, _vertex) = false

0 commit comments

Comments
 (0)