Record Class Graph.Edge
java.lang.Object
java.lang.Record
smile.graph.Graph.Edge
- Record Components:
u- the vertex id. For directed graph, this is the tail of arc.v- the other vertex id. For directed graph, this is the head of arc.weight- the weight of edge. For unweighted graph, this is always 1.
- All Implemented Interfaces:
Comparable<Graph.Edge>
- Enclosing class:
Graph
public static record Graph.Edge(int u, int v, double weight)
extends Record
implements Comparable<Graph.Edge>
Graph edge.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.intu()Returns the value of theurecord component.intv()Returns the value of thevrecord component.doubleweight()Returns the value of theweightrecord component.
-
Constructor Details
-
Edge
public Edge(int u, int v) Constructor of unweighted edge.- Parameters:
u- the vertex id.v- the other vertex id.
-
Edge
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<Graph.Edge>
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
u
-
v
-
weight
-