Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@yermilov
Created March 5, 2017 23:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yermilov/cf90e7eef1975bad9cc302f53612ef6a to your computer and use it in GitHub Desktop.
Save yermilov/cf90e7eef1975bad9cc302f53612ef6a to your computer and use it in GitHub Desktop.
class TiebreakerKey28 implements Comparable<TiebreakerKey28> {
int value
int hashCode() {
28
}
boolean equals(o) {
if (this.is(o)) return true
if (getClass() != o.class) return false
TiebreakerKey28 key = (TiebreakerKey28) o
if (value != key.value) return false
return true
}
@Override
int compareTo(TiebreakerKey28 other) {
this.value <=> other.value
}
}
HashMap<TiebreakerKey28, String> hashMap = new HashMap<>()
11.times {
hashMap.put(new TiebreakerKey28(value: it), "hello for the $it time")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment