Skip to content
Snippets Groups Projects
Commit 88790c6c authored by Thomas Oster's avatar Thomas Oster
Browse files

better equals implementation

parent 11948a00
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,8 @@ import com.t_oster.liblasercut.BlackWhiteRaster;
import com.t_oster.liblasercut.Customizable;
import com.t_oster.liblasercut.GreyscaleRaster;
import com.t_oster.liblasercut.TimeIntensiveOperation;
import com.t_oster.liblasercut.platform.Util;
import java.util.Arrays;
/**
*
......@@ -91,18 +93,14 @@ public abstract class DitheringAlgorithm extends TimeIntensiveOperation implemen
final DitheringAlgorithm other = (DitheringAlgorithm) o;
String[] own = this.getPropertyKeys();
String[] ot = other.getPropertyKeys();
if (own.length != ot.length)
if (!Arrays.deepEquals(own, ot))
{
return false;
}
for (int i = 0; i < own.length; i++)
{
String key = own[i];
if (!key.equals(ot[i]))
{
return false;
}
else if (!getProperty(key).equals(other.getProperty(key)))
if (!Util.differ(getProperty(key),other.getProperty(key)))
{
return false;
}
......
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