Package com.gengoai.graph
Interface EdgeFactory<V>
-
- Type Parameters:
V
- the type parameter
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
DirectedEdgeFactory
,UndirectedEdgeFactory
public interface EdgeFactory<V> extends Serializable
Interface for creating new edges.- Author:
- David B. Bracewell
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Edge<V>
createEdge(V from, V to, double weight)
Creates an edge between the from and to vertices with the given weightEdge<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
Edge<V> createEdge(V from, V to, double weight)
Creates an edge between the from and to vertices with the given weight- Parameters:
from
- the fromto
- the toweight
- the weight- Returns:
- the edge
-
createEdge
Edge<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. weight) using theJsonEntry
. This method is used for deserializing a graph from json.- Parameters:
from
- the fromto
- the toentry
- the entry- Returns:
- the edge
-
getEdgeClass
Class<? extends Edge> getEdgeClass()
Gets the type of edge this factory generates (used to validate edges being added to the graph).- Returns:
- the edge class
-
isDirected
boolean isDirected()
Indicates whether the factor produces directed or undirected edges.- Returns:
- True if the edges constructed in this factory are directed, False indicates undirected
-
-