Skip to content
Snippets Groups Projects
Commit 0aac67c8 authored by felmer's avatar felmer
Browse files

LMS-1870 implements equals() and hashcode()

SVN: 18745
parent bda4c706
No related branches found
No related tags found
No related merge requests found
...@@ -37,4 +37,25 @@ public final class Size ...@@ -37,4 +37,25 @@ public final class Size
{ {
return height; return height;
} }
@Override
public int hashCode()
{
return 37 * width + height;
}
@Override
public boolean equals(Object obj)
{
if (obj == this)
{
return true;
}
if (obj instanceof Size == false)
{
return false;
}
Size size = (Size) obj;
return size.width == width && size.height == height;
}
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment