From 8f82a725dac77ca83a6f03e54b7b3e6403f53b71 Mon Sep 17 00:00:00 2001 From: zheng Date: Mon, 27 Aug 2018 19:47:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F=20hashcode?= =?UTF-8?q?&&assistutils?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/fr/plugin/demo/DemoChart.java | 10 ++++++++-- src/com/fr/plugin/demo/DemoDataConfig.java | 12 +++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/com/fr/plugin/demo/DemoChart.java b/src/com/fr/plugin/demo/DemoChart.java index de8d864..1ba5bbe 100644 --- a/src/com/fr/plugin/demo/DemoChart.java +++ b/src/com/fr/plugin/demo/DemoChart.java @@ -15,6 +15,7 @@ import com.fr.json.JSONFactory; import com.fr.json.JSONObject; import com.fr.plugin.transform.ExecuteFunctionRecord; import com.fr.plugin.transform.FunctionRecorder; +import com.fr.stable.AssistUtils; import com.fr.stable.web.Repository; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; @@ -75,12 +76,17 @@ public class DemoChart extends AbstractChart{ return result; } + @Override + public int hashCode() { + return super.hashCode() + AssistUtils.hashCode(this.getTitleFormula(), this.getThemeType()); + } + @Override public boolean equals(Object ob) { return super.equals(ob) && ob instanceof DemoChart - && ComparatorUtils.equals(this.getTitleFormula(), ((DemoChart) ob).getTitleFormula()) - && ComparatorUtils.equals(this.getThemeType(), ((DemoChart) ob).getThemeType()) + && AssistUtils.equals(this.getTitleFormula(), ((DemoChart) ob).getTitleFormula()) + && AssistUtils.equals(this.getThemeType(), ((DemoChart) ob).getThemeType()) ; } diff --git a/src/com/fr/plugin/demo/DemoDataConfig.java b/src/com/fr/plugin/demo/DemoDataConfig.java index 9f2c5d9..84ea99a 100644 --- a/src/com/fr/plugin/demo/DemoDataConfig.java +++ b/src/com/fr/plugin/demo/DemoDataConfig.java @@ -3,6 +3,7 @@ package com.fr.plugin.demo; import com.fr.extended.chart.AbstractDataConfig; import com.fr.extended.chart.ExtendedField; import com.fr.general.ComparatorUtils; +import com.fr.stable.AssistUtils; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; @@ -71,12 +72,17 @@ public class DemoDataConfig extends AbstractDataConfig { return result; } + @Override + public int hashCode() { + return super.hashCode() + AssistUtils.hashCode(this.getX(), this.getY(), this.getZ()); + } + @Override public boolean equals(Object obj) { return obj instanceof DemoDataConfig - && ComparatorUtils.equals(this.getX(), ((DemoDataConfig) obj).getX()) - && ComparatorUtils.equals(this.getY(), ((DemoDataConfig) obj).getY()) - && ComparatorUtils.equals(this.getZ(), ((DemoDataConfig) obj).getZ()) + && AssistUtils.equals(this.getX(), ((DemoDataConfig) obj).getX()) + && AssistUtils.equals(this.getY(), ((DemoDataConfig) obj).getY()) + && AssistUtils.equals(this.getZ(), ((DemoDataConfig) obj).getZ()) ; } }