2.2 Class Edge
This class represents an edge of the graph. You must implement these public methods:
• Edge (Node u, Node v, int type): the constructor for the class. The first two parameters are the
endpoints of the edge. The last parameter is the type of the edge; when representing the labyrinth, if
an edge represents a door the type of the edge represents the type of the door.
• Edge (Node u, Node v, int type, String label): another constructor for the class. The first
two parameters are the endpoints of the edge. The last parameters are the type and label of the
edge. When representing a labyrinth, you can use the label to distinguish between edges representing
corridors and edges representing doors.
• Node firstEndpoint (): returns the first endpoint of the edge.
• Node secondEndpoint(): returns the second endpoint of the edge.
• int getType(): returns the type of the edge.
• setType(int newType): sets the type of the edge to the specified value.
• String getLabel(): returns the label of the edge.
• setLabel (String newLabel): sets the label of the edge to the specified value.
For example consider edge (u, v). The first endpoint of this edge is node u and the second endpoint is node
v. The label of the edge could be \"corridor\" if the edge represents a corridor. The label of the edge could
be \"door\" if the edge represents a door and the type of the edge would correspond to the type of the door.