Package com.gengoai.graph
Class UndirectedEdge<V>
- java.lang.Object
-
- com.gengoai.graph.Edge<V>
-
- com.gengoai.graph.UndirectedEdge<V>
-
- Type Parameters:
V
- The type of vertex
- All Implemented Interfaces:
Serializable
public class UndirectedEdge<V> extends Edge<V>
An undirected weighted edge implementation.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
UndirectedEdge(V vertex1, V vertex2, double weight)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
double
getWeight()
int
hashCode()
boolean
isDirected()
boolean
isWeighted()
void
setWeight(double weight)
Sets the weight of the edgeString
toString()
-
Methods inherited from class com.gengoai.graph.Edge
directedEdge, directedEdge, getFirstVertex, getOppositeVertex, getSecondVertex, undirectedEdge, undirectedEdge
-
-
-
-
Method Detail
-
getWeight
public double getWeight()
-
isDirected
public boolean isDirected()
- Specified by:
isDirected
in classEdge<V>
- Returns:
- True if the edge is directed, False if not
-
isWeighted
public boolean isWeighted()
- Overrides:
isWeighted
in classEdge<V>
- Returns:
- True if the edge has a weight, false otherwise
-
setWeight
public void setWeight(double weight)
Description copied from class:Edge
Sets the weight of the edge
-
-