com.phasmidsoftware.gryphon.builder
Members list
Type members
Classlikes
A purely functional builder that constructs a typed graph from a resource file or file-system path, using the GraphParser / Parseable infrastructure.
A purely functional builder that constructs a typed graph from a resource file or file-system path, using the GraphParser / Parseable infrastructure.
GraphBuilder is parameterised on the vertex type V, edge type E, and the concrete graph type G. Callers obtain an instance via the companion-object factory methods GraphBuilder.undirected and GraphBuilder.directed, which supply the appropriate triplesToTryGraph function for each graph flavour.
The two Parseable context bounds are satisfied automatically for the built-in types Int, Double, String, etc., and can be provided by the caller for custom domain types (e.g. Building, TunnelProperties).
Type parameters
- E
-
the edge attribute type.
- G
-
the concrete graph type, must be a subtype of
Graph[V]. - V
-
the vertex attribute type.
Value parameters
- build
-
a function that converts a sequence of parsed triplets into a
Try[G].
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Companion object providing factory methods for the two standard graph flavours.
Companion object providing factory methods for the two standard graph flavours.
Usage (built-in types):
val g: Try[UndirectedGraph[Int, Double]] =
GraphBuilder.undirected[Int, Double].fromResource("prim.graph")
val g: Try[DirectedGraph[Int, Double]] =
GraphBuilder.directed[Int, Double].fromResource("routes.graph")
Usage (custom types — supply Parseable instances for V and E):
given Parseable[Building] = ...
given Parseable[TunnelProperties] = ...
val g: Try[UndirectedGraph[Building, TunnelProperties]] =
GraphBuilder.undirected[Building, TunnelProperties].fromResource("tunnels.graph")
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
GraphBuilder.type