Package com.gengoai.graph
Class DirectedEdgeFactory<V>
- java.lang.Object
-
- com.gengoai.graph.DirectedEdgeFactory<V>
-
- All Implemented Interfaces:
EdgeFactory<V>
,Serializable
public class DirectedEdgeFactory<V> extends Object implements EdgeFactory<V>, Serializable
Edge factory forDirectedEdge
s- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DirectedEdgeFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DirectedEdge<V>
createEdge(V from, V to, double weight)
Creates an edge between the from and to vertices with the given weightDirectedEdge<V>
createEdge(V from, V to, JsonEntry entry)
Creates an edge between the from and to vertices filling in any given edge properties (e.g.Class<? extends Edge>
getEdgeClass()
Gets the type of edge this factory generates (used to validate edges being added to the graph).boolean
isDirected()
Indicates whether the factor produces directed or undirected edges.
-
-
-
Method Detail
-
createEdge
public DirectedEdge<V> createEdge(V from, V to, double weight)
Description copied from interface:EdgeFactory
Creates an edge between the from and to vertices with the given weight- Specified by:
createEdge
in interfaceEdgeFactory<V>
- Parameters:
from
- the fromto
- the toweight
- the weight- Returns:
- the edge
-
isDirected
public boolean isDirected()
Description copied from interface:EdgeFactory
Indicates whether the factor produces directed or undirected edges.- Specified by:
isDirected
in interfaceEdgeFactory<V>
- Returns:
- True if the edges constructed in this factory are directed, False indicates undirected
-
createEdge
public DirectedEdge<V> createEdge(V from, V to, JsonEntry entry)
Description copied from interface:EdgeFactory
Creates an edge between the from and to vertices filling in any given edge properties (e.g. weight) using theJsonEntry
. This method is used for deserializing a graph from json.- Specified by:
createEdge
in interfaceEdgeFactory<V>
- Parameters:
from
- the fromto
- the toentry
- the entry- Returns:
- the edge
-
getEdgeClass
public Class<? extends Edge> getEdgeClass()
Description copied from interface:EdgeFactory
Gets the type of edge this factory generates (used to validate edges being added to the graph).- Specified by:
getEdgeClass
in interfaceEdgeFactory<V>
- Returns:
- the edge class
-
-