public class DirectedWeightedEdgeGraph<E extends EdgeWeightData,V extends DirectedEdgeDataVertex<E> & EdgeWeightVertex<E>> extends DirectedEdgeDataGraph<E,V> implements WeightedEdgeGraph
DEFAULT_WEIGHT_EPSILON
Constructor and Description |
---|
DirectedWeightedEdgeGraph()
Initialize an empty graph using the default values for weightEpsilon and initial capacity.
|
DirectedWeightedEdgeGraph(java.util.Collection<V> vertices)
Use the vertices in a collection as the initial vertices in the graph and
set weight epsilon to the default value.
|
DirectedWeightedEdgeGraph(java.util.Collection<V> vertices,
double weightEpsilon)
Use the vertices in a collection as the initial vertices in the graph and
set weight epsilon to the specified value.
|
DirectedWeightedEdgeGraph(double weightEpsilon)
Initialize an empty graph using the given value for weightEpsilon and default initial capacity.
|
DirectedWeightedEdgeGraph(int initialCapacity)
Initialize an empty graph to have capacity for the given number of vertices and
the default weight epsilon.
|
DirectedWeightedEdgeGraph(int initialCapacity,
double weightEpsilon)
Initialize an empty graph to have capacity for the given number of vertices and
the specified weight epsilon.
|
Modifier and Type | Method and Description |
---|---|
boolean |
areEqualWeights(double w1,
double w2)
Determine if 2 floating point weights are to be considered equal in the given graph.
|
double |
getWeightEpsilon()
Retrieve the epsilon used to determine weight equality in the given graph.
|
edgeCount
addVertex, containsEdge, containsVertex, getVertices, removeVertex, vertexCount, vertexIterator
public DirectedWeightedEdgeGraph()
public DirectedWeightedEdgeGraph(double weightEpsilon)
weightEpsilon
- weight epsilon to be used to determine weight equality
in this graphpublic DirectedWeightedEdgeGraph(java.util.Collection<V> vertices)
vertices
- collection of vertices that will make up the initial vertices
of the graphpublic DirectedWeightedEdgeGraph(java.util.Collection<V> vertices, double weightEpsilon)
vertices
- collection of vertices that will make up the initial vertices
of the graphweightEpsilon
- weight epsilon to be used to determine weight equality
in this graphpublic DirectedWeightedEdgeGraph(int initialCapacity)
initialCapacity
- expected number of vertices in the graphpublic DirectedWeightedEdgeGraph(int initialCapacity, double weightEpsilon)
initialCapacity
- expected number of vertices in the graphweightEpsilon
- weight epsilon to be used to determine weight equality
in this graphpublic boolean areEqualWeights(double w1, double w2)
WeightedEdgeGraph
areEqualWeights
in interface WeightedEdgeGraph
w1
- one of the weights to be tested for equalityw2
- the other weight to be tested for equalitypublic double getWeightEpsilon()
WeightedEdgeGraph
getWeightEpsilon
in interface WeightedEdgeGraph