Package dev.nm.graph.type
Class SimpleArc<V>
- java.lang.Object
-
- dev.nm.graph.type.SimpleArc<V>
-
- Type Parameters:
V- vertex type
- All Implemented Interfaces:
Arc<V>,Edge<V>,HyperEdge<V>,WeightedArc<V>,WeightedEdge<V>
public class SimpleArc<V> extends Object implements WeightedArc<V>
A simple arc has two vertices: head and tail.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublecost()Gets the cost or weight of this edge.Vhead()Vneighbor(V vertex)Gets the neighboring vertex connected tovertex.Set<V>neighbors(V vertex)Gets the set of neighboring vertices connected tovertex.Vtail()Get the tail of this arc.StringtoString()Set<V>vertices()Gets the set of vertices associated with the edge.
-
-
-
Method Detail
-
cost
public double cost()
Description copied from interface:WeightedEdgeGets the cost or weight of this edge.- Specified by:
costin interfaceWeightedEdge<V>- Returns:
- the edge cost
-
neighbor
public V neighbor(V vertex)
Description copied from interface:EdgeGets the neighboring vertex connected tovertex.
-
neighbors
public Set<V> neighbors(V vertex)
Description copied from interface:HyperEdgeGets the set of neighboring vertices connected tovertex.
-
vertices
public Set<V> vertices()
Description copied from interface:HyperEdgeGets the set of vertices associated with the edge.
-
-