public class GraphEdge extends java.lang.Object implements Edge<GraphVertex>
| Constructor and Description |
|---|
GraphEdge() |
GraphEdge(GraphVertex origin,
GraphVertex destination)
Creates an edge with the specified origin and destination vertices
|
GraphEdge(GraphVertex origin,
GraphVertex destination,
int weight)
Creates an edge with the specified origin vertex, destination vertex and weight
|
| Modifier and Type | Method and Description |
|---|---|
GraphVertex |
getDestination() |
GraphVertex |
getOrigin() |
int |
getWeight() |
void |
setDestination(GraphVertex destination) |
void |
setOrigin(GraphVertex origin) |
void |
setWeight(int weight) |
public GraphEdge()
public GraphEdge(GraphVertex origin, GraphVertex destination, int weight)
origin - Origin vertexdestination - Destination vertexweight - Weightpublic GraphEdge(GraphVertex origin, GraphVertex destination)
origin - Origin vertexdestination - Destination vertexpublic int getWeight()
getWeight in interface Edge<GraphVertex>public void setWeight(int weight)
setWeight in interface Edge<GraphVertex>weight - Weight to setpublic void setOrigin(GraphVertex origin)
setOrigin in interface Edge<GraphVertex>origin - Origin vertex to setpublic void setDestination(GraphVertex destination)
setDestination in interface Edge<GraphVertex>destination - Destination vertex to setpublic GraphVertex getOrigin()
getOrigin in interface Edge<GraphVertex>public GraphVertex getDestination()
getDestination in interface Edge<GraphVertex>