StringHashCode() static private méthode

static private StringHashCode ( Lucene.Net.Facet.Taxonomy.WriterCache.CharBlockArray labelRepository, int offset ) : int
labelRepository Lucene.Net.Facet.Taxonomy.WriterCache.CharBlockArray
offset int
Résultat int
        public override int GetOrdinal(FacetLabel label)
        {
            if (label == null)
            {
                return(LabelToOrdinal.INVALID_ORDINAL);
            }

            int hash = CompactLabelToOrdinal.StringHashCode(label);

            for (int i = 0; i < this.hashArrays.Length; i++)
            {
                int ord = GetOrdinal(this.hashArrays[i], label, hash);
                if (ord != COLLISION)
                {
                    return(ord);
                }
            }

            return(this.collisionMap.Get(label, hash));
        }
        public override void AddLabel(FacetLabel label, int ordinal)
        {
            if (collisionMap.Count > threshold)
            {
                Grow();
            }

            int hash = CompactLabelToOrdinal.StringHashCode(label);

            for (int i = 0; i < this.hashArrays.Length; i++)
            {
                if (AddLabel(this.hashArrays[i], label, hash, ordinal))
                {
                    return;
                }
            }

            int prevVal = collisionMap.AddLabel(label, hash, ordinal);

            if (prevVal != ordinal)
            {
                throw new ArgumentException("Label already exists: " + label + " prev ordinal " + prevVal);
            }
        }