예제 #1
0
        protected override int FreezeImpl()
        {
            int code = base.FreezeImpl();

            _fs.Freeze();
            code = code * 31 + _fs.GetFrozenHashCode();
            return(code);
        }
예제 #2
0
        public override int GetHashCode()
        {
            int code = 23;

            code = code * 31 + _enqueueCount.GetHashCode();
            if (_fs != null)
            {
                code = code * 31 + _fs.GetFrozenHashCode();
            }
            return(_negatedFSs.Aggregate(code, (c, nfs) => c ^ nfs.GetFrozenHashCode()));
        }
예제 #3
0
파일: Word.cs 프로젝트: papeh/hermitcrab
        protected override int FreezeImpl()
        {
            int code = 23;

            _shape.Freeze();
            code = code * 31 + _shape.GetFrozenHashCode();
            _realizationalFS.Freeze();
            code = code * 31 + _realizationalFS.GetFrozenHashCode();
            foreach (Word nonHead in _nonHeads)
            {
                nonHead.Freeze();
                code = code * 31 + nonHead.GetFrozenHashCode();
            }
            code = code * 31 + _stratum.GetHashCode();
            code = code * 31 + (_rootAllomorph == null ? 0 : _rootAllomorph.GetHashCode());
            code = code * 31 + _mrules.GetSequenceHashCode();
            code = code * 31 + _isLastAppliedRuleFinal.GetHashCode();
            return(code);
        }
예제 #4
0
        public void Freeze()
        {
            if (IsFrozen)
            {
                return;
            }
            IsFrozen = true;
            _fs.Freeze();
            if (_children != null)
            {
                _children.Freeze();
            }

            _hashCode = 23;
            _hashCode = _hashCode * 31 + _fs.GetFrozenHashCode();
            _hashCode = _hashCode * 31 + (_children == null ? 0 : _children.GetFrozenHashCode());
            _hashCode = _hashCode * 31 + _optional.GetHashCode();
            _hashCode = _hashCode * 31 + Range.GetHashCode();
        }
예제 #5
0
 public override int GetHashCode()
 {
     return(FeatureStruct.GetFrozenHashCode());
 }