Commit 921bb7e2 authored by Martin Wunderlich's avatar Martin Wunderlich

Issue 22 incorrect equals() method in Tag and derived classes - add hashcode() methods

parent 787485ad
......@@ -443,4 +443,8 @@ public class CTag extends Tag {
}
}
@Override
public int hashCode() {
return cc.hashCode() + data.hashCode() + String.valueOf(initialWithData).hashCode() + dataRef.hashCode() + dataDir.hashCode() + disp.hashCode() + equiv.hashCode() + subFlows.hashCode() + canReorder.hashCode();
}
}
......@@ -189,4 +189,8 @@ public class MTag extends Tag implements IWithITSAttributes {
mc.setITSItems(itsItems);
}
@Override
public int hashCode() {
return mc.hashCode() + tagType.hashCode();
}
}
......@@ -242,4 +242,9 @@ public class TermTag extends MTag {
if ( tagType.compareTo(termtag.getTagType()) != 0 ) return false;
return mc.equals(termtag.mc);
}
@Override
public int hashCode() {
return super.hashCode() + annotatorRef.hashCode() + termConfidence.hashCode();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment