MCPcopy
hub / github.com/kevin-wayne/algs4 / compareTo

Method compareTo

src/main/java/edu/princeton/cs/algs4/Edge.java:94–97  ·  view source on GitHub ↗

Compares two edges by weight. Note that compareTo() is not consistent with equals(), which uses the reference equality implementation inherited from Object. @param that the other edge @return a negative integer, zero, or positive integer depending on whether the wei

(Edge that)

Source from the content-addressed store, hash-verified

92 * argument edge
93 */
94 @Override
95 public int compareTo(Edge that) {
96 return Double.compare(this.weight, that.weight);
97 }
98
99 /**
100 * Returns a string representation of this edge.

Callers 15

sortMethod · 0.45
lessMethod · 0.45
getMethod · 0.45
putMethod · 0.45
deleteMethod · 0.45
floorMethod · 0.45
ceilingMethod · 0.45
rankMethod · 0.45
keysMethod · 0.45
sizeMethod · 0.45
isBSTMethod · 0.45
isRankConsistentMethod · 0.45

Calls 1

compareMethod · 0.45

Tested by

no test coverage detected