Package com.gengoai.graph
Class UndirectedEdgeFactory<V>
- java.lang.Object
-
- com.gengoai.graph.UndirectedEdgeFactory<V>
-
- All Implemented Interfaces:
EdgeFactory<V>
,Serializable
public class UndirectedEdgeFactory<V> extends Object implements EdgeFactory<V>, Serializable
Factory for creating undirected edges.- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UndirectedEdgeFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UndirectedEdge<V>
createEdge(V from, V to, double weight)
Creates an edge between the from and to vertices with the given weightUndirectedEdge<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 UndirectedEdge<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 UndirectedEdge<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
-
-