MCPcopy Create free account
hub / github.com/davidgiven/luje / hashCode

Method hashCode

lib/java/util/AbstractSet.java:75–84  ·  view source on GitHub ↗

Returns the hash code for this set. Two set which are equal must return the same value. This implementation calculates the hash code by adding each element's hash code. @return the hash code of this set. @see #equals

()

Source from the content-addressed store, hash-verified

73 * @see #equals
74 */
75 @Override
76 public int hashCode() {
77 int result = 0;
78 Iterator<?> it = iterator();
79 while (it.hasNext()) {
80 Object next = it.next();
81 result += next == null ? 0 : next.hashCode();
82 }
83 return result;
84 }
85
86 /**
87 * Removes all occurrences in this collection which are contained in the

Callers

nothing calls this directly

Calls 4

hashCodeMethod · 0.95
iteratorMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65

Tested by

no test coverage detected