コード例 #1
0
        /// <summary>Returns true if <code>o</code> is equal to this.  If a
        /// {@link SortComparatorSource} (deprecated) or {@link
        /// FieldCache.Parser} was provided, it must properly
        /// implement hashCode (unless a singleton is always
        /// used).
        /// </summary>
        public override int GetHashCode()
        {
            int hash = type ^ 0x346565dd + (reverse ? Boolean.TrueString.GetHashCode() : Boolean.FalseString.GetHashCode()) ^ unchecked ((int)0xaf5998bb);

            if (field != null)
            {
                hash += (field.GetHashCode() ^ unchecked ((int)0xff5685dd));
            }
            if (locale != null)
            {
                hash += (locale.GetHashCode() ^ 0x08150815);
            }
            if (factory != null)
            {
                hash += (factory.GetHashCode() ^ 0x34987555);
            }
            if (comparatorSource != null)
            {
                hash += comparatorSource.GetHashCode();
            }
            if (parser != null)
            {
                hash += (parser.GetHashCode() ^ 0x3aaf56ff);
            }
            return(hash);
        }
コード例 #2
0
        public AsciiLineAnalysisOption(IAsciiSeparationStrategy s, System.Globalization.CultureInfo n, System.Globalization.CultureInfo d)
        {
            _separationStrategy = s;
            _numberFormat       = n;
            _dateTimeFormat     = d;

            _cachedHashCode = _separationStrategy.GetHashCode() ^ _numberFormat.GetHashCode() ^ _dateTimeFormat.GetHashCode();
        }
コード例 #3
0
		public AsciiLineAnalysisOption(IAsciiSeparationStrategy s, System.Globalization.CultureInfo n, System.Globalization.CultureInfo d)
		{
			_separationStrategy = s;
			_numberFormat = n;
			_dateTimeFormat = d;

			_cachedHashCode = _separationStrategy.GetHashCode() ^ _numberFormat.GetHashCode() ^ _dateTimeFormat.GetHashCode();
		}
コード例 #4
0
ファイル: FieldCacheImpl.cs プロジェクト: philiphoy/ravendb
 /// <summary>Composes a hashcode based on the field and type. </summary>
 public override int GetHashCode()
 {
     return(field.GetHashCode() ^ type ^ (custom == null?0:custom.GetHashCode()) ^ (locale == null?0:locale.GetHashCode()));
 }