Skip to content

Instantly share code, notes, and snippets.

@amckinley
Created March 30, 2016 22:35
Show Gist options
  • Save amckinley/22092062d32a6850fc378fbe0a42a4f8 to your computer and use it in GitHub Desktop.
Save amckinley/22092062d32a6850fc378fbe0a42a4f8 to your computer and use it in GitHub Desktop.
public String toString() {
String result = "";
for (int i = 0; i < this.numBuckets; i++) {
LinkedList<Map.Entry<K, V>>> current = this.internalList.get(i);
String bucketStatus;
if (current == null) {
bucketStatus = "bucket " + i + " is empty";
} else {
bucketStatus = "bucket " + i + " has " + current.size() + " items";
}
result.append(bucketStatus);
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment