public virtual void TestHashCodeEquals() { long[] values = new long[] { 5, 8, 8, 15, 32 }; EliasFanoEncoder efEncoder1 = MakeEncoder(values, EliasFanoEncoder.DEFAULT_INDEX_INTERVAL); EliasFanoEncoder efEncoder2 = MakeEncoder(values, EliasFanoEncoder.DEFAULT_INDEX_INTERVAL); Assert.AreEqual(efEncoder1, efEncoder2); Assert.AreEqual(efEncoder1.GetHashCode(), efEncoder2.GetHashCode()); EliasFanoEncoder efEncoder3 = MakeEncoder(new long[] { 1, 2, 3 }, EliasFanoEncoder.DEFAULT_INDEX_INTERVAL); Assert.IsFalse(efEncoder1.Equals(efEncoder3)); Assert.IsFalse(efEncoder3.Equals(efEncoder1)); Assert.IsFalse(efEncoder1.GetHashCode() == efEncoder3.GetHashCode()); // implementation ok for these. }
public override bool Equals(object other) { return((other is EliasFanoDocIdSet otherEncoder) && efEncoder.Equals(otherEncoder.efEncoder)); }
public override bool Equals(object other) { return(((other is EliasFanoDocIdSet)) && EfEncoder.Equals(((EliasFanoDocIdSet)other).EfEncoder)); }