Class Edge
java.lang.Object
org.unifi.mecvirtualresourceallocation.graph.Edge
Represents an edge in a conflict graph. Each edge connects two vertices.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if this edge is equal to another object.Gets the first vertex connected by the edge.Gets the second vertex connected by the edge.int
hashCode()
Returns a hash code value for the edge.toString()
Returns a string representation of the edge, including the IDs of the connected vertices.
-
Constructor Details
-
Edge
Constructs an edge connecting the specified vertices. Ensures that the vertices are stored in a consistent order based on their IDs.- Parameters:
vertex1
- the first vertex connected by the edgevertex2
- the second vertex connected by the edge
-
-
Method Details
-
getVertex1
Gets the first vertex connected by the edge.- Returns:
- the first vertex
-
getVertex2
Gets the second vertex connected by the edge.- Returns:
- the second vertex
-
equals
Checks if this edge is equal to another object. Two edges are considered equal if they connect the same pair of vertices. -
hashCode
public int hashCode()Returns a hash code value for the edge. The hash code is computed based on the vertices connected by the edge. -
toString
Returns a string representation of the edge, including the IDs of the connected vertices.
-