Last change
on this file was 1, checked in by Wouter Pasman, 7 years ago |
Initial import : Genius 9.0.0
|
File size:
533 bytes
|
Line | |
---|
1 | package genius.core.xml;
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * Utility object for use with HashMaps. With this you can create a unique key
|
---|
5 | * with a given string value. Allows us to use multiple different keys (equals
|
---|
6 | * returs false) while the toString is in fact identical.
|
---|
7 | */
|
---|
8 | public class Key {
|
---|
9 |
|
---|
10 | private String name;
|
---|
11 |
|
---|
12 | public Key(String string) {
|
---|
13 | this.name = string;
|
---|
14 | }
|
---|
15 |
|
---|
16 | @Override
|
---|
17 | public int hashCode() {
|
---|
18 | return 0;
|
---|
19 | }
|
---|
20 |
|
---|
21 | @Override
|
---|
22 | public boolean equals(Object obj) {
|
---|
23 | return this == obj;
|
---|
24 | }
|
---|
25 |
|
---|
26 | @Override
|
---|
27 | public String toString() {
|
---|
28 | return name;
|
---|
29 | }
|
---|
30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.