Package squidpony.squidai.graph
Class Connection<V>
java.lang.Object
squidpony.squidai.graph.Edge<V>
squidpony.squidai.graph.Connection<V>
- Type Parameters:
V
- the vertex type; oftenCoord
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Connection.DirectedConnection
,Connection.UndirectedConnection
public class Connection<V> extends Edge<V> implements Serializable
The most-commonly-used class that represents an edge between nodes on a Graph. Different kinds of graph will use
different subclasses of this to represent their edges:
Connection.DirectedConnection
or Connection.UndirectedConnection
.
These subclasses don't add new functionality, but they compare differently during hashing and equality checks.- Author:
- earlygrey
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Connection.DirectedConnection<V>
A Connection that treats A-to-B as a different edge from B-to-A.static class
Connection.UndirectedConnection<V>
A Connection that treats A-to-B and B-to-A as the same edge. -
Field Summary
-
Constructor Summary
Constructors Constructor Description Connection()
Connection(Node<V> a, Node<V> b)
Connection(Node<V> a, Node<V> b, float weight)
-
Method Summary
-
Field Details
-
DEFAULT_WEIGHT
- See Also:
- Constant Field Values
-
a
-
b
-
weight
-
-
Constructor Details
-
Connection
public Connection() -
Connection
-
Connection
-
-
Method Details
-
set
-
getInternalNodeA
- Specified by:
getInternalNodeA
in classEdge<V>
-
getInternalNodeB
- Specified by:
getInternalNodeB
in classEdge<V>
-
getA
-
getB
-
getWeight
-
setWeight
-
getNodeA
-
getNodeB
-