コード例 #1
0
ファイル: NumericConfig.cs プロジェクト: wwb/lucenenet
 /// <summary>
 /// LUCENENET specific - Visual Studio provides a compiler warning if
 /// <see cref="Equals(object)"/> is overridden without <see cref="GetHashCode()"/>,
 /// so we provide an implementation that mirrors <see cref="Equals(object)"/>.
 /// </summary>
 public override int GetHashCode()
 {
     return(HashHelpers.CombineHashCodes(
                base.GetHashCode(),
                this.precisionStep.GetHashCode(),
                this.type.GetHashCode(),
                this.format.GetHashCode()));
 }
コード例 #2
0
ファイル: SpanOrQuery.cs プロジェクト: kushanp/lucene.net
        public override int GetHashCode()
        {
            //If this doesn't work, hash all elemnts together instead. This version was used to reduce time complexity
            int h = clauses.Count == 0 ? 0 : HashHelpers.CombineHashCodes(clauses.First().GetHashCode(), clauses.Last().GetHashCode(), clauses.Count);

            h ^= (h << 10) | ((int)(((uint)h) >> 23));
            h ^= Number.FloatToIntBits(Boost);
            return(h);
        }
コード例 #3
0
        public override int GetHashCode()
        {
            int result;

            //If this doesn't work, hash all elements together. This version was used to improve the speed of hashing
            result = HashHelpers.CombineHashCodes(clauses.First().GetHashCode(), clauses.Last().GetHashCode(), clauses.Count);
            // Mix bits before folding in things like boost, since it could cancel the
            // last element of clauses.  this particular mix also serves to
            // differentiate SpanNearQuery hashcodes from others.
            result ^= (result << 14) | ((int)((uint)result >> 19)); // reversible
            result += Number.FloatToIntBits(Boost);
            result += slop;
            result ^= (inOrder ? unchecked ((int)0x99AFD3BD) : 0);
            return(result);
        }
コード例 #4
0
 public override int GetHashCode()
 {
     int a = Item1 != null?Item1.GetHashCode() : 0; int b = Item2 != null?Item2.GetHashCode() : 0; return(HashHelpers.CombineHashCodes(a, b));
 }
コード例 #5
0
 /// <summary>
 /// Returns a hash code value for this object. </summary>
 public override int GetHashCode()
 {
     return(Number.FloatToIntBits(Boost) ^ (clauses.Count == 0 ? 0 : HashHelpers.CombineHashCodes(clauses.First().GetHashCode(), clauses.Last().GetHashCode(), clauses.Count)) + MinimumNumberShouldMatch + (DisableCoord ? 17 : 0));
 }
コード例 #6
0
 /// <summary>
 /// LUCENENET specific: need to override GetHashCode to
 /// prevent a compiler warning and realistically, the hash code
 /// should work similarly to Equals.
 /// </summary>
 public override int GetHashCode()
 {
     return(HashHelpers.CombineHashCodes(base.GetHashCode(), hasIndexedLeaves.GetHashCode()));
 }
コード例 #7
0
 /// <summary>
 /// Returns a hash code value for this object. </summary>
 public override int GetHashCode()
 {
     //If this doesn't work hash all elements of positions. This was used to reduce time overhead
     return(Number.FloatToIntBits(Boost) ^ slop ^ TermArraysHashCode() ^ ((positions.Count == 0) ? 0 : HashHelpers.CombineHashCodes(positions.First().GetHashCode(), positions.Last().GetHashCode(), positions.Count) ^ 0x4AC65113));
 }