Esempio n. 1
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null)
            {
                return(false);
            }
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }
            MergeInfo other = (MergeInfo)obj;

            if (EstimatedMergeBytes != other.EstimatedMergeBytes)
            {
                return(false);
            }
            if (IsExternal != other.IsExternal)
            {
                return(false);
            }
            if (MergeMaxNumSegments != other.MergeMaxNumSegments)
            {
                return(false);
            }
            if (TotalDocCount != other.TotalDocCount)
            {
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
 private IOContext(UsageContext context, MergeInfo mergeInfo)
 {
     Debug.Assert(context != UsageContext.MERGE || mergeInfo != null, "MergeInfo must not be null if context is MERGE");
     Debug.Assert(context != UsageContext.FLUSH, "Use IOContext(FlushInfo) to create a FLUSH IOContext");
     this.Context   = context;
     this.ReadOnce  = false;
     this.MergeInfo = mergeInfo;
     this.FlushInfo = null;
 }
Esempio n. 3
0
        public override int GetHashCode()
        {
            const int prime  = 31;
            int       result = 1;

            result = prime * result + /*((Context == null) ? 0 :*/ Context.GetHashCode() /*)*/; // LUCENENET NOTE: Enum can never be null in .NET
            result = prime * result + ((FlushInfo == null) ? 0 : FlushInfo.GetHashCode());
            result = prime * result + ((MergeInfo == null) ? 0 : MergeInfo.GetHashCode());
            result = prime * result + (ReadOnce ? 1231 : 1237);
            return(result);
        }
Esempio n. 4
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null)
            {
                return(false);
            }
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }
            IOContext other = (IOContext)obj;

            if (Context != other.Context)
            {
                return(false);
            }
            if (FlushInfo == null)
            {
                if (other.FlushInfo != null)
                {
                    return(false);
                }
            }
            else if (!FlushInfo.Equals(other.FlushInfo))
            {
                return(false);
            }
            if (MergeInfo == null)
            {
                if (other.MergeInfo != null)
                {
                    return(false);
                }
            }
            else if (!MergeInfo.Equals(other.MergeInfo))
            {
                return(false);
            }
            if (ReadOnce != other.ReadOnce)
            {
                return(false);
            }
            return(true);
        }
Esempio n. 5
0
 public IOContext(MergeInfo mergeInfo)
     : this(UsageContext.MERGE, mergeInfo)
 {
 }