N - Type of nodepublic class DefaultConnection<N> extends java.lang.Object implements Connection<N>
DefaultConnection is a Connection whose cost is 1.| Modifier and Type | Field and Description |
|---|---|
protected N |
fromNode |
protected N |
toNode |
| Constructor and Description |
|---|
DefaultConnection(N fromNode,
N toNode) |
| Modifier and Type | Method and Description |
|---|---|
float |
getCost()
Returns the non-negative cost of this connection
|
N |
getFromNode()
Returns the node that this connection came from
|
N |
getToNode()
Returns the node that this connection leads to
|
public float getCost()
ConnectiongetCost in interface Connection<N>public N getFromNode()
ConnectiongetFromNode in interface Connection<N>public N getToNode()
ConnectiongetToNode in interface Connection<N>